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.
Install using CLI
Install Manually
Copy and paste the following files into the same folder.
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
Props
<Snippet />
coderequiredstring
[...props]InputGroupProps
<SnippetAddon />
[...props]InputGroupAddonProps
<SnippetText />
[...props]InputGroupTextProps
<SnippetInput />
[...props]InputGroupInputProps
<SnippetCopyButton />
timeoutnumber
@copy() => void
@error(error: Error) => void
[...props]InputGroupButtonProps