Использование
Компонент 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 и другие.
<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
Пропсы
Слоты
Тема
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'
}
}
}
}