MCPcopy Create free account
hub / github.com/Qovery/react-xtermjs / App

Function App

example/src/App.jsx:3–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useXTerm } from 'react-xtermjs'
2
3function App() {
4 const { instance, ref } = useXTerm()
5 instance?.writeln('Hello from react-xtermjs!')
6 instance?.onData((data) => instance?.write(data))
7
8 return (
9 <div className="flex flex-col gap-5 bg-gray-100 p-14 min-h-screen">
10 <button
11 type="button"
12 onClick={() => instance?.reset()}
13 className="transition-colors text-white hover:bg-gray-800 bg-gray-900 focus:outline-none focus:ring-2 focus:ring-gray-300 tracking-wide rounded-lg text-sm px-5 py-2.5 max-w-fit mx-auto"
14 >
15 Clear terminal
16 </button>
17 <div className="p-3 rounded overflow-hidden border border-gray-300 shadow-lg">
18 <div ref={ref} />
19 </div>
20 </div>
21 )
22}
23
24export default App

Callers

nothing calls this directly

Calls 1

useXTermFunction · 0.85

Tested by

no test coverage detected