Skip to main content
Skip to design system navigation

CMD-LINE

Source: design-system/components/CmdLine/CmdLine.tsx. React Server Component, zero client JavaScript.

Props

PropTypeDefaultRequired
PropcommandTypestringDefaultnoneRequiredyes
PropuserTypestringDefaultnoneRequiredyes
ProppromptTypestringDefault':~$'Requiredno
PropoutputTypeReactNodeDefaultnoneRequiredno
PropclassNameTypestringDefaultnoneRequiredno, 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.