Variant
Size
Copyable
Line numbers
Rounded
Description
Max height
TokenConfig
TypeScript
<CodeBlock
     variant="titled"
     title="TokenConfig"
     language="TypeScript"
     copyable
     rounded={false}
     code={snippet}
/>

npm install @my/design-system
doc.md
Markdown
This is a Markdown block !
npx sv create my-app


Svelte
<CodeBlock code={snippet} copyable />

API


PropTypeDefault
variant"simple" | "titled" | "filename" | "tabbed" | "terminal""simple"
size"sm" | "md" | "lg""md"
titlestringundefined
filenamestringundefined
descriptionstringundefined
description_srcstringundefined
languagestringundefined
tabsTab[]undefined
codestringundefined
code_srcstringundefined
copyablebooleanfalse
line_numbersbooleanfalse
roundedbooleanfalse
widthstringundefined
max_heightstringundefined
Prop variant
Type "simple" | "titled" | "filename" | "tabbed" | "terminal"
Default "simple"
Prop size
Type "sm" | "md" | "lg"
Default "md"
Prop title
Type string
Default undefined
Prop filename
Type string
Default undefined
Prop description
Type string
Default undefined
Prop description_src
Type string
Default undefined
Prop language
Type string
Default undefined
Prop tabs
Type Tab[]
Default undefined
Prop code
Type string
Default undefined
Prop code_src
Type string
Default undefined
Prop copyable
Type boolean
Default false
Prop line_numbers
Type boolean
Default false
Prop rounded
Type boolean
Default false
Prop width
Type string
Default undefined
Prop max_height
Type string
Default undefined