v2.15.0

PageFeature

Компонент для показа основных возможностей вашего приложения.

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

Компонент PageFeature используется компонентом PageSection для показа возможностей.

Заголовок

Пропс title задаёт заголовок возможности.

Тема
<template>
  <B24PageFeature title="Тема" />
</template>
Заголовок по умолчанию отрисовывается как div. Чтобы отрисовать его как заголовок, передайте в пропс as объект, например :as="{ title: 'h3' }". Корневой элемент задаётся так же: :as="{ root: 'section', title: 'h3' }".

Описание

Пропс description задаёт описание возможности.

Тема
Настройте Bitrix24 UI.
<template>
  <B24PageFeature title="Тема" description="Настройте Bitrix24 UI." />
</template>

Иконка

Пропс icon задаёт иконку возможности.

Тема
Настройте Bitrix24 UI.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24PageFeature title="Тема" description="Настройте Bitrix24 UI." :icon="RocketIcon" />
</template>

Можно передать любое свойство компонента <NuxtLink>, например to, target, rel и другие.

Тема
Настройте Bitrix24 UI.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24PageFeature
    title="Тема"
    description="Настройте Bitrix24 UI."
    :icon="RocketIcon"
    to="/docs/getting-started/theme/design-system/"
    target="_blank"
  />
</template>

Ориентация

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

Тема
Настройте Bitrix24 UI.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24PageFeature
    orientation="vertical"
    title="Тема"
    description="Настройте Bitrix24 UI."
    :icon="RocketIcon"
  />
</template>

API

Пропсы

Prop Default Type
as'div'any

The element or component this component should render as.

iconIconComponent

The icon displayed next to the title when orientation is horizontal and above the title when orientation is vertical.

title string
description string
orientation'horizontal' "horizontal" | "vertical"

The orientation of the page feature.

to string | J | W
target null | "_blank" | "_parent" | "_self" | "_top" | string & {}
b24ui { root?: SlotClass; wrapper?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; title?: SlotClass; description?: SlotClass; }

Слоты

Slot Type
leading{ b24ui: object; }
title{}
description{}
default{}

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/page-feature.ts
export default {
  slots: {
    root: 'relative rounded-sm',
    wrapper: '',
    leading: 'inline-flex items-center justify-center',
    leadingIcon: 'size-5 shrink-0 text-(--ui-color-accent-main-primary)',
    title: 'text-(length:--ui-font-size-md) text-pretty font-(--ui-font-weight-semi-bold) text-legend',
    description: 'text-(length:--ui-font-size-sm) text-pretty text-description'
  },
  variants: {
    orientation: {
      horizontal: {
        root: 'flex items-start gap-2.5',
        leading: 'p-0.5'
      },
      vertical: {
        leading: 'mb-2.5'
      }
    },
    to: {
      true: {
        root: 'has-focus-visible:ring-2 has-focus-visible:ring-(--ui-color-accent-soft-element-blue) transition'
      }
    },
    title: {
      true: {
        description: 'mt-1'
      }
    }
  }
}