Components
Code
Code is a component used to display inline code, with ability to copy the content by a button.
Installation
pnpm dlx shadcn@latest add https://reui.io/r/code.json
Examples
Default
Loading
Copy Button
Loading
Variants
Loading
Sizes
Loading
API Reference
This component provides a flexible way to display inline code snippets with optional copy functionality.
Code
Prop | Type | Default |
---|---|---|
variant | default | |
size | default | |
showCopyButton | false | |
copyText | ||
asChild | false | |
className |
Credits
- Built with class-variance-authority for variant management.
- Icons from Lucide React.