Skip to content
Components / Composition

Snippet

A command or short code with a copy button.

@fabrials/ui
Loading state
curl -fsSL https://fabrials.com/install/spanreed.sh | sh
irm https://fabrials.com/install/spanreed.ps1 | iex

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Snippet, CopyButton } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
promptstringShown before each line and left out of the copy, "$" by default.
labelstringNames the snippet.
copyValuestringWhat to copy when it differs from what is shown.

Behavior

Long commands wrap with a hanging indent instead of scrolling.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.