ICodeProps
interface
Data Display
Props for OrigamCode — a shiki-powered code block with line numbers, line highlighting, copy button, compact pill mode and theme awareness.
TypeScript
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
Inheritance
Extends
Parent interfaces this one inherits from. Their properties are available on every consumer of this interface.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- codestring
- The code to highlight. When omitted the default slot is used as the source. When both are provided the prop wins.
- langTCodeLangOpen
- Language grammar to apply (e.g. "typescript", "vue"). Unknown values fall back to "plaintext" with a one-shot console warning.
- lineNumbersboolean
- Show a left gutter with line numbers. Pure CSS — uses a CSS counter incremented per .origam-code__row.
- highlightLinesnumber[] | string | null
- Lines to highlight. Accepts a pre-computed array of 1-based line numbers or a comma/range string ("2,5-7"). null / empty disables the feature.
- copyableboolean
- Show the copy-to-clipboard button in the top-right corner. Defaults to true.
- formatboolean
- Auto-format the code before highlighting. Reserved for v3 — currently a no-op that warns once in dev.
- wrapboolean
- Wrap long lines instead of scrolling horizontally. Off by default so the visual column matches the source file.
- filenamestring
- Optional filename rendered in the header bar (e.g. "App.vue"). When provided and copyable is true, the header also hosts the copy button.
- compactboolean
- Render the block as a single-line pill — ideal for a copyable install command. Suppresses header, filename and line-numbers.
- promptstring
- Decorative prompt prefix rendered before the code (e.g. "$" for a shell command). Purely visual — never included in the clipboard copy.
- hideHeaderboolean
- flatboolean
- scrollerAriaLabelstring
Ecosystem
Used by
Components and composables that extend or consume this interface.
Usage
Examples
Ready-to-paste code snippets using this interface.
Basic code block with language and line numbers
Compact install-command pill