--- ## CodePanel Shared code display primitive with Shiki syntax highlighting, collapsible panel, and copy-to-clipboard. **Import:** `import { CodePanel } from '@urbicon-ui/docs';` ### Variants - size: lg, md, sm (default: md) ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | code | `string` | yes | | Source code string to display with syntax highlighting. | | ...CodePanelVariantProps | `VariantProps` | no | | Styling variants from CodePanelVariantProps | | class | `string` | no | | Extra classes merged onto the root element. | | expanded | `boolean` | no | | Controlled expanded state. When omitted, the panel manages its own state. | | label | `string` | no | | Human-readable title that names the read-only code region for assistive tech (`aria-label` on the `role="textbox"`). Composed as `Code example: {label}`; falls back to `Code example` when omitted so the name is never empty. | | language | `string` | no | 'svelte' | Language for syntax highlighting and the toolbar language tag. | | lineNumbers | `boolean | 'auto'` | no | 'auto' | Show line numbers in the gutter. `'auto'` (the default) shows them only from `LINE_NUMBER_AUTO_THRESHOLD` lines up — a snippet short enough to take in at a glance (an import one-liner) gains nothing from a `1` in front of it. Pass `true`/`false` to force it either way. Numbers are rendered as CSS generated content, so they are never part of the copied text or a selection. | | onToggle | `() => void` | no | | Called when the toggle button is clicked. Required when `expanded` is controlled. | | slotClasses | `Partial>` | no | | Per-slot class overrides for internal elements. | | unstyled | `boolean` | no | | Remove all default tv styles from internal slots. | | size | `'lg' | 'md' | 'sm'` | no | md | Controls the dimensions, padding, and text size of the CodePanel. Affects the component's physical footprint. Available options: lg, md, sm. | Inherited from: - CodePanelVariantProps (external) ### Types ```ts type CodePanelSlotName = CodePanelSlots ``` ### Slots (slotClasses keys) `root`, `toolbar`, `codeToggle`, `codeChevron`, `languageTag`, `copyButton`, `copySeparator`, `codeCollapse`, `codeDisplay`, `codeContent`