Terminal API

API documentation for Terminal component

Terminal#

Props#

Defines valid properties in Terminal component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TerminalInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TerminalInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<TerminalPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: TerminalInstance) => ReactNode)
null
The children to render.
promptstring
null
Prompt text for each command.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Terminal component.

nametypedefaultdescription
commandTextstring
null
Current command text being typed.
commandsTerminalCommandItem[]
null
Array of commands and their responses.

Exposes#

Defines the methods and properties exposed by Terminal component.

nametypedefaultdescription
stateuseTerminalState
null
State of the terminal.
inputRefRefObject<HTMLInputElement>
null
Reference to the input element.
onClick() => void
null
Click handler for terminal container.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Key down handler for input element.
onInputChange(event: ChangeEvent<HTMLInputElement>) => void
null
Input change handler.

Interfaces#

Defines passthrough(pt) options of Terminal component.

nametypedefaultdescription
rootTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
commandListTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the commandList's DOM element.
commandsTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the commands' DOM element.
commandValueTerminalPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the command value's DOM element.
commandResponseTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the command response's DOM element.
promptTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the prompt's DOM element.
promptValueTerminalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the prompt value's DOM element.
promptLabelTerminalPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the prompt label's DOM element.

Types#

Instance of Terminal component.

values
ComponentInstance<TerminalProps, TerminalState, TerminalExposes>

TerminalWelcome#

Props#

Defines valid properties in TerminalWelcome component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TerminalWelcomeInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TerminalWelcomeInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<TerminalWelcomePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: TerminalWelcomeInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by TerminalWelcome component.

nametypedefaultdescription
terminalTerminalInstance
null
The Terminal component instance.

Interfaces#

Defines passthrough(pt) options of TerminalWelcome component.

nametypedefaultdescription
rootTerminalWelcomePassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of TerminalWelcome component.

values
ComponentInstance<TerminalWelcomeProps, TerminalWelcomeState, TerminalWelcomeExposes>

TerminalCommandList#

Props#

Defines valid properties in TerminalCommandList component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TerminalCommandListInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TerminalCommandListInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<TerminalCommandListPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: TerminalCommandListInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by TerminalCommandList component.

nametypedefaultdescription
terminalTerminalInstance
null
The Terminal component instance.

Interfaces#

Defines passthrough(pt) options of TerminalCommandList component.

nametypedefaultdescription
rootTerminalCommandListPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of TerminalCommandList component.

values
ComponentInstance<TerminalCommandListProps, TerminalCommandListState, TerminalCommandListExposes>

useTerminal#

Props#

Defines valid properties in useTerminal.

nametypedefaultdescription
promptstring
null
Prompt text for each command.

State#

Defines valid state in useTerminal.

nametypedefaultdescription
commandTextstring
null
Current command text being typed.
commandsTerminalCommandItem[]
null
Array of commands and their responses.

Exposes#

Defines the methods and properties exposed by useTerminal.

nametypedefaultdescription
stateuseTerminalState
null
State of the terminal.
inputRefRefObject<HTMLInputElement>
null
Reference to the input element.
onClick() => void
null
Click handler for terminal container.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Key down handler for input element.
onInputChange(event: ChangeEvent<HTMLInputElement>) => void
null
Input change handler.

Types#

Instance of useTerminal headless.

values
HeadlessInstance<useTerminalProps, useTerminalState, useTerminalExposes>