v2.15.0

ColorModeSwitch

Switch для переключения между светлой и тёмной темой.

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

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

<template>
  <B24ColorModeSwitch />
</template>

API

Пропсы

Prop Default Type
as'div'any

The element or component this component should render as.

loadingfalseboolean

When true, the loading icon will be displayed

size'md' "md" | "xs" | "sm" | "lg"
color'air-primary'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-warning" | "air-primary-copilot"
autofocus false | true | "true" | "false"
disabledboolean

When true, prevents the user from interacting with the switch.

name string

The name of the field. Submitted with its owning form as part of a name/value pair.

label string
defaultValueboolean

The state of the switch when it is initially rendered. Use when you do not need to control its state.

requiredboolean

When true, indicates that the user must set the value before the owning form can be submitted.

id string
highlightboolean

Highlight the ring color like a focus state.

value string

The value given as data when submitted with a name.

description string
loadingIconicons.refreshIconComponent

The icon when the loading prop is true.

trueValueboolean

The value used when the switch is on. Defaults to true.

falseValueboolean

The value used when the switch is off. Defaults to false.

b24ui { root?: SlotClass; base?: SlotClass; container?: SlotClass; thumb?: SlotClass; icon?: SlotClass; wrapper?: SlotClass; label?: SlotClass; description?: SlotClass; }