UNPKG

retro-react

Version:

A React component library for building retro-style websites

37 lines (36 loc) 1.31 kB
/// <reference types="react" /> import { ThemeUICSSObject } from 'theme-ui'; export interface TerminalProps extends React.HTMLAttributes<HTMLDivElement> { /** * The prompt symbol displayed at the beginning of the terminal line. * * @default "C:\\>" */ prompt?: string; /** * A callback function that is invoked when a command is submitted by the user. * The entered command is passed as an argument. * * @example (cmd) => console.log(`User entered: ${cmd}`) */ onCommandSubmit?: (command: string) => void; /** * The sx prop lets you style elements inline, using values from your theme and * provides a shorthand for adding responsive styles. */ sx?: ThemeUICSSObject; /** * A callback function that is invoked whenever the input text changes. * The current text in the input is passed as an argument. * * @example (text) => console.log(`Current text: ${text}`) */ getCurrentText?: (text: string) => void; } /** * Terminal component that mimics the old command-line terminals. * * @example * <Terminal prompt="$" /> */ export declare const Terminal: import("react").ForwardRefExoticComponent<TerminalProps & import("react").RefAttributes<HTMLDivElement>>;