v2.15.0

FooterColumns

Набор колонок со ссылками для навигации и информации в подвале.

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

Компонент FooterColumns отрисовывает список колонок для вашего Footer.

Используйте его в слоте top компонента Footer:

<template>
  <B24Footer>
    <template #top>
      <B24Container>
        <B24FooterColumns />
      </B24Container>
    </template>
  </B24Footer>
</template>

Колонки

Пропс columns — массив объектов со свойствами:

  • label: string
  • children?: FooterColumnLink[]

Каждая колонка содержит массив children с объектами-ссылками. У ссылки могут быть свойства:

  • label?: string
  • icon?: IconComponent
  • class?: any
  • b24ui?: { item?: ClassNameValue, link?: ClassNameValue, linkLabel?: ClassNameValue, linkLabelExternalIcon?: ClassNameValue, linkLeadingIcon?: ClassNameValue }

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

<script setup lang="ts">
import type { FooterColumn } from '@bxshefby/b24ui-nuxt'
import GitHubIcon from '@bitrix24/b24icons-vue/social/GitHubIcon'

const columns: FooterColumn[] = [
  {
    label: 'Сообщество',
    children: [
      {
        label: 'Bitrix24 на GitHub',
        to: 'https://github.com/bitrix24',
        icon: GitHubIcon,
        target: '_blank'
      }
    ]
  },
  {
    label: 'Решения',
    children: [
      {
        label: 'Bitrix24 JsSdk',
        to: 'https://bitrix24.github.io/b24jssdk/',
        target: '_blank'
      },
      {
        label: 'Иконки Bitrix24',
        to: 'https://bitrix24.github.io/b24icons/',
        target: '_blank'
      },
      {
        label: 'Bitrix24 UI',
        to: 'https://bitrix24.github.io/b24ui/',
        target: '_blank'
      }
    ]
  }
]
</script>

<template>
  <B24FooterColumns :columns="columns">
    <template #right>
      <B24FormField name="email" label="Подписаться на нашу рассылку" size="lg">
        <B24Input type="email" class="w-full">
          <template #trailing>
            <B24Button type="submit" size="xs" label="Подписаться" />
          </template>
        </B24Input>
      </B24FormField>
    </template>
  </B24FooterColumns>
</template>
Подпись колонки по умолчанию отрисовывается как h3. Чтобы изменить тег, передайте в пропс as объект, например :as="{ label: 'h4' }". Корневой элемент задаётся так же: :as="{ root: 'div', label: 'h4' }".

API

Пропсы

Prop Default Type
as'nav'any

The element or component this component should render as.

columns FooterColumn<T>[]
b24ui { root?: SlotClass; left?: SlotClass; center?: SlotClass; right?: SlotClass; label?: SlotClass; list?: SlotClass; item?: SlotClass; link?: SlotClass; linkLeadingIcon?: SlotClass; linkLabel?: SlotClass; linkLabelExternalIcon?: SlotClass; }

Слоты

Slot Type
left{}
default{}
right{}
column-label{ column: FooterColumn<T>; }
link{ link: T; active: boolean; b24ui: object; }
link-leading{ link: T; active: boolean; b24ui: object; }
link-label{ link: T; active: boolean; }
link-trailing{ link: T; active: boolean; }

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/footer-columns.ts
export default {
  slots: {
    root: 'xl:grid xl:grid-cols-3 xl:gap-8',
    left: 'mb-10 xl:mb-0',
    center: 'flex flex-col lg:grid grid-flow-col auto-cols-fr gap-8 xl:col-span-2',
    right: 'mt-10 xl:mt-0',
    label: 'text-(length:--ui-font-size-lg)/[normal] font-(--ui-font-weight-semi-bold)',
    list: 'mt-6 space-y-4',
    item: 'relative',
    link: 'group text-sm flex items-center gap-1.5 focus-visible:outline-1 focus-visible:outline-(--ui-color-design-outline-focused-stroke)',
    linkLeadingIcon: 'size-5 shrink-0',
    linkLabel: 'truncate',
    linkLabelExternalIcon: 'inline-block size-[14px] text-(--ui-color-design-plain-content-icon-secondary)'
  },
  variants: {
    active: {
      true: {
        link: 'text-primary font-medium'
      },
      false: {
        link: 'text-description hover:text-label transition-colors'
      }
    }
  }
}