v2.15.0

ProseCodeGroup

Несколько фрагментов кода во вкладках для наглядности.

Использование

Компонент code-group объединяет блоки кода во вкладки.

pnpm add @bxshefby/b24ui-nuxt
::code-group

```bash [pnpm]
pnpm add @bxshefby/b24ui-nuxt
```

```bash [yarn]
yarn add @bxshefby/b24ui-nuxt
```

```bash [npm]
npm install @bxshefby/b24ui-nuxt
```

```bash [bun]
bun add @bxshefby/b24ui-nuxt
```

::
Как и компонент ProsePre, CodeGroup показывает имена файлов, иконки и кнопку копирования.

API

Пропсы

Prop Default Type
defaultValue'0' string

The default tab to select.

sync string

Sync the selected tab with a local storage key.

modelValue string
b24ui { root?: SlotClass; list?: SlotClass; indicator?: SlotClass; trigger?: SlotClass; triggerIcon?: SlotClass; triggerLabel?: SlotClass; }

Слоты

Slot Type
default{}

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/code-group.ts
export default {
  slots: {
    root: 'relative group *:not-first:my-0! *:not-first:static! my-5',
    list: 'relative flex items-center gap-1 border border-(--ui-color-design-tinted-na-stroke) bg-(--ui-color-bg-content-secondary) border-b-0 rounded-t-md overflow-x-auto p-2',
    indicator: 'absolute left-0 inset-y-2 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position) transition-[translate,width] motion-reduce:transition-none duration-200 bg-(--ui-color-design-selection-bg) rounded-md shadow-xs',
    trigger: 'relative inline-flex items-center gap-1.5 text-legend data-[state=active]:text-legend hover:bg-(--ui-color-design-selection-bg) px-2 py-1.5 text-sm rounded-md disabled:cursor-not-allowed disabled:opacity-30 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-color-accent-soft-element-blue) focus:outline-none transition-colors',
    triggerIcon: 'size-4 shrink-0',
    triggerLabel: 'truncate'
  }
}