npm.io
1.0.6 • Published 2 years ago

react-bate-terminal

Licence
MIT
Version
1.0.6
Deps
3
Size
42 kB
Vulns
0
Weekly
0

react-b-terminal

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save react-bate-terminal --force

Usage

import React ,{ useState } from 'react'

import { BTerminal } from 'react-bate-terminal'

function myComponent(){
  const [show, setShow] = useState(false)
  const data = [{
    command : "hello",
    output: "world"
  },
  {
    command: "mail",
    output: () => {/* when you are creating funcion this will execute when your command input
      like this */
      alert("hello world!");
    }
  },
  {
    command : "close",
    output: "close"
  },
  {
    command : "help",
    output : "this is help message for your terminal"
  }
  ]
  const close = () =>{ // command is close and exit this is default 
    setShow(false);
  }
  
    return <BTerminal close={close} main="this is main text" data={data} />
  
}

License

MIT https://github.com/Kaung-Myat-Hun