CodeBlock
Blok kódu s copy tlačítkem, čísly řádků, filename headerem a dark / light / transparent variantami
Installation
Usage
Preview
Varianty
button.tsx
| 1 | import { Button } from "@/components/ui/button" |
| 2 | |
| 3 | export function Demo() { |
| 4 | return <Button label="Klikni" color="primary" /> |
| 5 | } |
bash
npx shadcn@latest add "https://registry.ceskysoftware.cz/TOKEN/r/button.json"tsx
const greeting = "Ahoj světe"Import
import { CodeBlock } from "@/components/ui/code-block"
Example
<CodeBlock
filename="components/button.tsx"
language="tsx"
code={`import { Button } from "@/components/ui/button"
export function Demo() {
return <Button label="Klikni" color="primary" />
}`}
lineNumbers
variant="default"
/>
// Dark varianta
<CodeBlock
code="npx shadcn@latest add 'https://registry.ceskysoftware.cz/TOKEN/r/button.json'"
variant="dark"
language="bash"
/>
Dependencies
@ceskysoftware/utils (registry)