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

All props accepted by this component, with their type, default value and description.

items
ICodeGroupItem[]
Tabs and their code: { label, code, lang?, filename?, value? }. Ignored when the default slot holds code blocks.
modelValue
string
Value of the active tab (v-model). Defaults to the first tab; an item value defaults to its label.
label
string
Accessible name of the tab list, also part of each panel scroller name so several groups on one page stay distinct.
copyable
boolean
Show the shared copy button.
lineNumbers
boolean
Show a line-number gutter in every panel.
wrap
boolean
Wrap long lines instead of scrolling horizontally.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string

API

Slots

Content slots exposed by this component.

#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

Events emitted by this component.

@update:modelValue
string
The active tab changed; carries the new tab value.
@copy
string
Emitted after a successful clipboard write, with the code of the active tab.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…