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

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

Héritage

Hérite de

Interfaces parentes dont celle-ci hérite. Leurs propriétés sont disponibles pour tout consommateur de cette interface.

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

code
string
The code to highlight. When omitted the default slot is used as the source. When both are provided the prop wins.
lang
TCodeLangOpen
Language grammar to apply (e.g. "typescript", "vue"). Unknown values fall back to "plaintext" with a one-shot console warning.
lineNumbers
boolean
Show a left gutter with line numbers. Pure CSS — uses a CSS counter incremented per .origam-code__row.
highlightLines
number[] | 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.
copyable
boolean
Show the copy-to-clipboard button in the top-right corner. Defaults to true.
format
boolean
Auto-format the code before highlighting. Reserved for v3 — currently a no-op that warns once in dev.
wrap
boolean
Wrap long lines instead of scrolling horizontally. Off by default so the visual column matches the source file.
filename
string
Optional filename rendered in the header bar (e.g. "App.vue"). When provided and copyable is true, the header also hosts the copy button.
compact
boolean
Render the block as a single-line pill — ideal for a copyable install command. Suppresses header, filename and line-numbers.
prompt
string
Decorative prompt prefix rendered before the code (e.g. "$" for a shell command). Purely visual — never included in the clipboard copy.
hideHeader
boolean
flat
boolean
scrollerAriaLabel
string

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Basic code block with language and line numbers

vue

Compact install-command pill

vue