---
title: "Separator"
description: "Разделяет содержимое по горизонтали или вертикали."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/separator"
---
# Separator

> Разделяет содержимое по горизонтали или вертикали.

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

Separator без настроек просто разделяет содержимое.

```vue
<template>
  <B24Separator />
</template>
```

### Ориентация

Пропс `orientation` меняет ориентацию Separator. По умолчанию `horizontal`.

```vue
<template>
  <B24Separator orientation="vertical" class="h-48" />
</template>
```

### Подпись

Пропс `label` показывает подпись посередине Separator.

```vue
<template>
  <B24Separator label="Bitrix24 UI" />
</template>
```

### Положение

Пропс `position` меняет положение содержимого Separator. По умолчанию `center`.

```vue
<template>
  <B24Separator position="start" label="Привет, мир" />
</template>
```

### Иконка

Пропс `icon` показывает [иконку](https://bitrix24.github.io/b24icons/icons/) посередине Separator.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24Separator :icon="RocketIcon" />
</template>
```

### Аватар

Пропс `avatar` показывает [Avatar](https://b24-ui.bx-shef.by/raw/docs/components/avatar.md) посередине Separator.

```vue
<template>
  <B24Separator :avatar="{src:'/b24ui/avatar/employee.png',loading:'lazy'}" />
</template>
```

### Акцент

Пропс `accent` меняет вариант Separator. По умолчанию `default`.

```vue
<template>
  <B24Separator accent="accent" type="solid" />
</template>
```

### Тип

Пропс `type` меняет тип Separator. По умолчанию `solid`.

```vue
<template>
  <B24Separator type="dashed" accent="accent" size="thick" />
</template>
```

### Размер

Пропс `size` меняет размер Separator. По умолчанию `thin`.

```vue
<template>
  <B24Separator size="thick" />
</template>
```

## API

### Пропсы

```ts
/**
 * Props for the Separator component
 */
interface SeparatorProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  /**
   * Display a label on the separator.
   */
  label?: string | undefined;
  /**
   * Display an icon on the separator.
   */
  icon?: (props: HTMLAttributes & VNodeProps & {}, ctx: Omit<{ attrs: Attrs; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: <Exposed extends Record<string, any> = Record<...>>(exposed?: Exposed | undefined) => void; }, "expose">): any | undefined;
  /**
   * Display an avatar on the separator
   */
  avatar?: AvatarProps | undefined;
  /**
   * @default 'default'
   */
  accent?: "default" | "accent" | "less" | undefined;
  /**
   * @default 'thin'
   */
  size?: "thin" | "thick" | undefined;
  /**
   * @default 'solid'
   */
  type?: "solid" | "double" | "dashed" | "dotted" | undefined;
  /**
   * The orientation of the separator.
   * @default 'horizontal'
   */
  orientation?: "horizontal" | "vertical" | undefined;
  /**
   * The position of the content.
   * @default 'center'
   */
  position?: "center" | "start" | "end" | undefined;
  b24ui?: { root?: SlotClass; border?: SlotClass; container?: SlotClass; icon?: SlotClass; avatar?: SlotClass; avatarSize?: SlotClass; label?: SlotClass; } | undefined;
  /**
   * Whether or not the component is purely decorative. <br>When `true`, accessibility-related attributes
   * are updated so that that the rendered element is removed from the accessibility tree.
   */
  decorative?: boolean | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the Separator component
 */
interface SeparatorSlots {
  default(): any;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    separator: {
      slots: {
        root: 'flex items-center text-center',
        border: '',
        container: 'font-[family-name:var(--ui-font-family-primary)] font-(--ui-font-weight-normal) flex',
        icon: 'shrink-0 size-7',
        avatar: 'shrink-0',
        avatarSize: 'sm',
        label: ''
      },
      variants: {
        accent: {
          default: {
            container: 'text-(--ui-color-design-plain-na-content-secondary) text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset)',
            border: 'border-(--ui-color-divider-vibrant-default)'
          },
          accent: {
            container: 'text-description text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset)',
            border: 'border-(--ui-color-divider-vibrant-accent-more)'
          },
          less: {
            container: 'text-(--ui-color-base-6) text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset)',
            border: 'border-(--ui-color-divider-vibrant-less)'
          }
        },
        orientation: {
          horizontal: {
            root: 'w-full flex-row',
            border: 'w-full',
            container: 'mx-3 whitespace-nowrap'
          },
          vertical: {
            root: 'h-full flex-col',
            border: 'h-full',
            container: 'my-2'
          }
        },
        size: {
          thin: '',
          thick: ''
        },
        position: {
          start: '',
          center: '',
          end: ''
        },
        type: {
          solid: {
            border: 'border-solid'
          },
          dashed: {
            border: 'border-dashed'
          },
          dotted: {
            border: 'border-dotted'
          },
          double: {
            border: 'border-double'
          }
        }
      },
      compoundVariants: [
        {
          orientation: 'horizontal',
          position: 'start',
          class: {
            container: 'me-3'
          }
        },
        {
          orientation: 'horizontal',
          position: 'center',
          class: {
            container: 'mx-3'
          }
        },
        {
          orientation: 'horizontal',
          position: 'end',
          class: {
            container: 'ms-3'
          }
        },
        {
          orientation: 'vertical',
          position: 'start',
          class: {
            container: 'mb-2'
          }
        },
        {
          orientation: 'vertical',
          position: 'center',
          class: {
            container: 'my-2'
          }
        },
        {
          orientation: 'vertical',
          position: 'end',
          class: {
            container: 'mt-2'
          }
        },
        {
          orientation: 'horizontal',
          size: 'thin',
          class: {
            border: 'border-t-(length:--ui-border-width-thin)'
          }
        },
        {
          orientation: 'horizontal',
          size: 'thick',
          class: {
            border: 'border-t-(length:--ui-border-width-thick)'
          }
        },
        {
          orientation: 'vertical',
          size: 'thin',
          class: {
            border: 'border-s-(length:--ui-border-width-thin)'
          }
        },
        {
          orientation: 'vertical',
          size: 'thick',
          class: {
            border: 'border-s-(length:--ui-border-width-thick)'
          }
        },
        {
          type: 'double',
          size: 'thick',
          orientation: 'horizontal',
          class: {
            border: 'border-t-[length:calc(var(--ui-border-width-thick)_+_1px)]'
          }
        },
        {
          type: 'double',
          size: 'thick',
          orientation: 'vertical',
          class: {
            border: 'border-s-[length:calc(var(--ui-border-width-thick)_+_1px)]'
          }
        }
      ],
      defaultVariants: {
        accent: 'default',
        size: 'thin',
        type: 'solid'
      }
    }
  }
})
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
