Snippet
Lightweight inline code display for terminal commands and short code references.
The Snippet component provides a lightweight way to display terminal commands and short code snippets with copy functionality. Built on top of InputGroup, it's designed for brief code references in text.
Loading preview…
Installation
npm i zjkm-ui-ai-elementsimport { Snippet, SnippetAddon, SnippetText, SnippetInput, SnippetCopyButton,} from "zjkm-ui-ai-elements/snippet";First time? Add the package's styles: see Setup.
Features
- Composable architecture with InputGroup
- Optional prefix text (e.g.,
$for terminal commands) - Built-in copy button
- Compact design for chat/markdown
Examples
Without Prefix
Loading preview…
Props
<Snippet />
Prop
Type
<SnippetAddon />
Prop
Type
<SnippetText />
Prop
Type
<SnippetInput />
Prop
Type
<SnippetCopyButton />
Prop
Type