CMD-LINE
Source: design-system/components/CmdLine/CmdLine.tsx. React Server Component, zero client JavaScript.
Props
| Prop | Type | Default | Required |
|---|---|---|---|
Propcommand | Typestring | Defaultnone | Requiredyes |
Propuser | Typestring | Defaultnone | Requiredyes |
Propprompt | Typestring | Default':~$' | Requiredno |
Propoutput | TypeReactNode | Defaultnone | Requiredno |
PropclassName | Typestring | Defaultnone | Requiredno, merged after the base classes |
Any other div attribute (id, aria-*, data-*) is forwarded to the root element.
Examples
erik@portfolio:~$cat README.md
root@prod:#whoami
root
SOURCE
<CmdLine user="erik@portfolio" command="cat README.md" />
<CmdLine user="root@prod" prompt=":#" command="whoami" output={<span>root</span>} />The prompt and user render in primary-400; the command and output render in tertiary-50. Segments wrap on narrow viewports.