Skip to content
Frauthy Brand
Frauthy index

Go anywhere.

    No exact contract found. Try a component family, product name, prop, or keyboard key.

    ↑↓ move↵ openesc close

    CodeBlock

    content

    Syntax-highlighted code block with copy-to-clipboard. Supports aterm variant with macOS traffic-light chrome and an optional caption.

    Preview

    Button Usage example
    import { Button } from 'PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED';
    
    function App() {
      return <Button variant="primary">Go</Button>;
    }
    $ PRIVATE_BETA_INSTALL_INSTRUCTIONS_REDACTED PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED
    Resolving packages...
    Done.

    Usage

    import { CodeBlock } from 'PRIVATE_BETA_PACKAGE_COORDINATE_REDACTED';
    
    <CodeBlock
      code={"const x = 1;"}
      caption="Example"
      language="typescript"
    />
    
    // Terminal variant
    <CodeBlock code={"$ bun dev"} term />

    Props

    PropTypeDefaultDescription
    codestringrequiredRaw code (HTML string with syntax-token spans)
    captionstring--Caption above the code block
    captionHighlightstring--Highlighted name in the caption
    languagestring--Language label for screen readers
    termbooleanfalseRenders traffic-light window chrome
    classstring--Additional CSS classes

    Accessibility

    Do / Don't

    Do

    Use the term variant for shell commands to visually distinguish them from source code.

    Don't

    Don't pass unsanitized user input as code -- it's rendered as innerHTML.