Skip to content

zk-code-group ​

Several code blocks in tabs (npm, yarn, pnpm...), chosen with radio buttons, so with no script.

Props ​

PropTypeDefaultDescription
tabsarray[]Items with label, code and, optionally, language and title
labelstring'Code'Accessible name of the group
idstring|nullnullIdentifier, also the name of the radio buttons
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

Each tab is a radio, a label and a panel that follow each other: the panel of the checked tab is shown by .code-group-input:checked + .code-group-tab + .code-group-panel, which is the style zk-styles prints (code-group). The choice is not kept between pages.

Examples ​

Install ​

blade
<x-zk-code-group :tabs="[
    ['label' => 'npm', 'code' => 'npm install @zairakai/vue-components'],
    ['label' => 'yarn', 'code' => 'yarn add @zairakai/vue-components'],
]" />

<x-zk-styles />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.