Function: LiveTerminal()
LiveTerminal(
options?:object):LiveTerminalElement
Creates an interactive shell for live demos.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { align?: Align; autoFocus?: boolean; blur?: number; brightness?: number; className?: string; color?: string; customPositioned?: boolean; cwd?: string; enterDelay?: number; enterDuration?: number; env?: Record<string, string>; exitDelay?: number; exitDuration?: number; fontSize?: number; height?: Size; id?: string; interactive?: boolean; onActivate?: () => void; onDeactivate?: () => void; onMount?: () => void; onUnmount?: () => void; opacity?: number; origin?: ElementAnchor; position?: Position; restartButton?: boolean; rotation?: number; rows?: number; scale?: number; shell?: string[]; size?: Size; style?: Properties<0 | string & object, string & object>; theme?: Partial<ThemeConfig>; title?: string; transcript?: string[]; width?: Size; x?: PositionCoord; y?: PositionCoord; } | - |
options.align? | Align | - |
options.autoFocus? | boolean | Whether the terminal takes keyboard focus on scene entry. Default: false. |
options.blur? | number | Blur in virtual pixels (default: 0). |
options.brightness? | number | Brightness multiplier (default: 1). |
options.className? | string | - |
options.color? | string | Foreground CSS color (default: component/theme color). |
options.customPositioned? | boolean | Whether this element manages its own CSS transform / positioning (disables stage translate3d). |
options.cwd? | string | Working directory for the shell, relative to the project root. Default: project root. |
options.enterDelay? | number | Delay in seconds before entering scene transition begins. |
options.enterDuration? | number | Duration in seconds for entering scene transition. |
options.env? | Record<string, string> | Environment variables passed to the shell process (e.g. { PS1: "$ " }). |
options.exitDelay? | number | Delay in seconds before exiting scene transition begins. |
options.exitDuration? | number | Duration in seconds for exiting scene transition. |
options.fontSize? | number | Font size in layout pixels before viewport scaling. Default: theme code size (1.25rem × stage scale). |
options.height? | Size | Height in stage units or CSS length (default: content size). |
options.id? | string | - |
options.interactive? | boolean | Whether keystrokes typed into the terminal reach the process. Default: true. |
options.onActivate? | () => void | - |
options.onDeactivate? | () => void | - |
options.onMount? | () => void | - |
options.onUnmount? | () => void | - |
options.opacity? | number | Whole-element opacity from 0 to 1 (default: 1). |
options.origin? | ElementAnchor | Which point of the element sits on its coordinate (default: "top-left"). |
options.position? | Position | - |
options.restartButton? | boolean | Whether the window header offers a button that starts a fresh session. Default: false. |
options.rotation? | number | Rotation in degrees (default: 0). |
options.rows? | number | Terminal rows. Default: fit to height (44 stage units by default). |
options.scale? | number | Scale multiplier (default: 1). |
options.shell? | string[] | Shell command and arguments. Default: the user's login shell. Example: ["bash", "--norc", "--noprofile"]. |
options.size? | Size | Both dimensions in stage units or CSS length (default: unset). |
options.style? | Properties<0 | string & object, string & object> | - |
options.theme? | Partial<ThemeConfig> | - |
options.title? | string | Header label. Default: "shell". |
options.transcript? | string[] | Fallback transcript shown when the terminal server is unavailable. Default: none. |
options.width? | Size | Width in stage units or CSS length (default: content size). |
options.x? | PositionCoord | Horizontal position in stage units (default: 0). |
options.y? | PositionCoord | Vertical position in stage units (default: 0). |