Skip to content

COMPONENT / typewriter-terminal

Typewriter Terminal_

Terminal panel that types its lines out once on mount, with optional prompt lines and a blinking block cursor. Requires @cybr/tokens and @cybr/effects.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/typewriter-terminal

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

> boot --style=brutal

mounting /dev/concrete ...... ok

loading neon.drv ............ ok

> _ready

Props

Component props
PropTypeDefaultDescription
lines{ text: string; prompt?: boolean }[]—Lines in order. Prompt lines get promptSymbol in front and render in --signal; other lines render in --ink.
promptSymbolstring"> "Prefix for prompt lines. It is typed out as part of the line.
charsPerSecondnumber40Typing speed across all lines. Values that are not finite or not above 0 fall back to 40.
classNamestring—Extra classes, merged after the defaults with cn().
...propsOmit<ComponentProps<"div">, "children">—Every other native <div> attribute and ref is forwarded.

Usage

Needs both stylesheets from @cybr/tokens and @cybr/effects, and @cybr/use-reduced-motion arrives with them. After the install, import them in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
@import "../styles/cybr-effects.css";
import { TypewriterTerminal } from "@/components/ui/typewriter-terminal";

export function Boot() {
  return (
    <TypewriterTerminal
      lines={[
        { text: "boot --style=brutal", prompt: true },
        { text: "mounting /dev/concrete ...... ok" },
      ]}
    />
  );
}

Behaviour

Accessibility