Skip to main content

Function: LiveTerminal()

LiveTerminal(options?: object): LiveTerminalElement

Creates an interactive shell for live demos.

Parameters​

ParameterTypeDescription
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?booleanWhether the terminal takes keyboard focus on scene entry. Default: false.
options.blur?numberBlur in virtual pixels (default: 0).
options.brightness?numberBrightness multiplier (default: 1).
options.className?string-
options.color?stringForeground CSS color (default: component/theme color).
options.customPositioned?booleanWhether this element manages its own CSS transform / positioning (disables stage translate3d).
options.cwd?stringWorking directory for the shell, relative to the project root. Default: project root.
options.enterDelay?numberDelay in seconds before entering scene transition begins.
options.enterDuration?numberDuration in seconds for entering scene transition.
options.env?Record<string, string>Environment variables passed to the shell process (e.g. { PS1: "$ " }).
options.exitDelay?numberDelay in seconds before exiting scene transition begins.
options.exitDuration?numberDuration in seconds for exiting scene transition.
options.fontSize?numberFont size in layout pixels before viewport scaling. Default: theme code size (1.25rem × stage scale).
options.height?SizeHeight in stage units or CSS length (default: content size).
options.id?string-
options.interactive?booleanWhether keystrokes typed into the terminal reach the process. Default: true.
options.onActivate?() => void-
options.onDeactivate?() => void-
options.onMount?() => void-
options.onUnmount?() => void-
options.opacity?numberWhole-element opacity from 0 to 1 (default: 1).
options.origin?ElementAnchorWhich point of the element sits on its coordinate (default: "top-left").
options.position?Position-
options.restartButton?booleanWhether the window header offers a button that starts a fresh session. Default: false.
options.rotation?numberRotation in degrees (default: 0).
options.rows?numberTerminal rows. Default: fit to height (44 stage units by default).
options.scale?numberScale multiplier (default: 1).
options.shell?string[]Shell command and arguments. Default: the user's login shell. Example: ["bash", "--norc", "--noprofile"].
options.size?SizeBoth dimensions in stage units or CSS length (default: unset).
options.style?Properties<0 | string & object, string & object>-
options.theme?Partial<ThemeConfig>-
options.title?stringHeader label. Default: "shell".
options.transcript?string[]Fallback transcript shown when the terminal server is unavailable. Default: none.
options.width?SizeWidth in stage units or CSS length (default: content size).
options.x?PositionCoordHorizontal position in stage units (default: 0).
options.y?PositionCoordVertical position in stage units (default: 0).

Returns​

LiveTerminalElement