v2.15.0

DashboardSidebarToggle

Кнопка мобильного меню, которая показывает или скрывает навигацию бокового меню.

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

Компонент DashboardSidebarToggle используют DashboardNavbar и DashboardSidebar.

На мобильных устройствах он показывается автоматически и переключает боковое меню, добавлять его вручную не нужно.

<template>
  <B24DashboardSidebarToggle />
</template>

Компонент расширяет Button, поэтому ему можно передать любое свойство: color, size и другие.

<template>
  <B24DashboardSidebarToggle color="air-primary" />
</template>
По умолчанию у кнопки color="air-tertiary".

Примеры

В слоте toggle

Хотя на мобильных устройствах компонент показывается автоматически, слот toggle компонентов DashboardNavbar и DashboardSidebar позволяет настроить кнопку.

<template>
  <B24DashboardGroup>
    <B24DashboardSidebar>
      <template #toggle>
        <B24DashboardSidebarToggle />
      </template>
    </B24DashboardSidebar>

    <slot />
  </B24DashboardGroup>
</template>
Пропс toggle-side компонентов DashboardSidebar и DashboardNavbar задаёт сторону, на которой стоит кнопка.

API

Пропсы

Prop Default Type
as'button'any

The element or component this component should render as when not a link.

color'air-tertiary'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost" | "link"
side'left' "left" | "right"

The side of the sidebar to toggle.

iconIconComponent

Display an icon on the left side.

avatar AvatarProps

Display an avatar on the left side.

loadingboolean

When true, the loading icon will be displayed.

autofocus false | true | "true" | "false"
disabledboolean
name string
type'button' "reset" | "submit" | "button"

The type of the button when not a link.

label string
activeColor"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost" | "link"
depth'normal' "light" | "normal" | "dark"
Deprecated — removed in 3.0.0

Renders nothing on the air-* colours, the default among them: the depth compound variants are keyed on the legacy colour names only.

activeDepth "light" | "normal" | "dark"
Deprecated — removed in 3.0.0

Same as depth — no effect on the air-* colours.

size'md' "xs" | "md" | "xss" | "sm" | "lg" | "xl"
roundedfalseboolean

Rounds the corners of the button

blockfalseboolean

Render the button full width

loadingAutofalseboolean

Set loading state automatically based on the @click promise state

normalCasetrueboolean

Disable uppercase label

useWaitfalseboolean

Shows LoaderWaitIcon in loading mode

useClockfalseboolean

Shows LoaderClockIcon icon in loading mode

useDropdownfalseboolean

Shows a dropdown chevron on the right side, from the dictionary's chevronDown role, so an app.config override reaches it.

b24ui { base?: any; }
Компонент поддерживает и все нативные HTML-атрибуты <button>.

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/dashboard-sidebar-toggle.ts
export default {
  base: 'lg:hidden',
  variants: {
    side: {
      left: '',
      right: ''
    }
  }
}