CodeGroup
Data Display
stable
Tabbed code blocks (npm / pnpm / yarn) drawn as one surface: one border, one shared copy button that copies the active tab, and a distinct accessible name for every panel scroller. Fed by an items array or by origam-code children.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- itemsICodeGroupItem[]
- Tabs and their code: { label, code, lang?, filename?, value? }. Ignored when the default slot holds code blocks.
- modelValuestring
- Value of the active tab (v-model). Defaults to the first tab; an item value defaults to its label.
- labelstring
- Accessible name of the tab list, also part of each panel scroller name so several groups on one page stay distinct.
- copyableboolean
- Show the shared copy button.
- lineNumbersboolean
- Show a line-number gutter in every panel.
- wrapboolean
- Wrap long lines instead of scrolling horizontally.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- origam-code children, one per tab, when items is not used. The tab label comes from the child label, else its filename.
- #copy
- Replaces the shared copy button. Receives the copy function and the copied flag.
API
Emits
Événements émis par ce composant.
- @update:modelValuestring
- The active tab changed; carries the new tab value.
- @copystring
- Emitted after a successful clipboard write, with the code of the active tab.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…