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.
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.
- 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
É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
Compact install-command pill