Usage
Use the v-model directive to control the value of the CheckboxGroup or the default-value prop to set the initial value when you do not need to control its state.
{
"wait": "Loading client-side content..."
}Items
Use the items prop as an array of strings or numbers:
{
"wait": "Loading client-side content..."
}You can also pass an array of objects with the following properties:
label?: stringdescription?: stringvalue?: stringdisabled?: booleanclass?: anyb24ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, description?: ClassNameValue }
{
"wait": "Loading client-side content..."
}value property of the object in the v-model directive or the default-value prop.Value Key
You can change the property that is used to set the value by using the value-key prop. Defaults to value.
{
"wait": "Loading client-side content..."
}Legend
Use the legend prop to set the legend of the CheckboxGroup.
{
"wait": "Loading client-side content..."
}Color
Use the color prop to change the color of the CheckboxGroup.
{
"wait": "Loading client-side content..."
}Variant
Use the variant prop to change the variant of the CheckboxGroup.
{
"wait": "Loading client-side content..."
}Size
Use the size prop to change the size of the CheckboxGroup.
{
"wait": "Loading client-side content..."
}Orientation
Use the orientation prop to change the orientation of the CheckboxGroup. Defaults to vertical.
{
"wait": "Loading client-side content..."
}Indicator
Use the indicator prop to change the position or hide the indicator. Defaults to start.
{
"wait": "Loading client-side content..."
}Disabled
Use the disabled prop to disable the CheckboxGroup.
{
"wait": "Loading client-side content..."
}API
Props
Slots
Emits
Theme
export default defineAppConfig({
b24ui: {
checkboxGroup: {
slots: {
root: 'relative',
fieldset: 'flex gap-x-2',
legend: 'mb-1.5 block text-(--b24ui-typography-label-color)',
item: ''
},
variants: {
orientation: {
horizontal: {
fieldset: 'flex-row'
},
vertical: {
fieldset: 'flex-col'
}
},
color: {
'air-primary': {
item: 'style-filled'
},
'air-primary-success': {
item: 'style-filled-success'
},
'air-primary-alert': {
item: 'style-filled-alert'
},
'air-primary-copilot': {
item: 'style-filled-copilot'
},
'air-primary-warning': {
item: 'style-filled-warning'
},
default: {
item: 'style-old-default'
},
danger: {
item: 'style-old-danger'
},
success: {
item: 'style-old-success'
},
warning: {
item: 'style-old-warning'
},
primary: {
item: 'style-old-primary'
},
secondary: {
item: 'style-old-secondary'
},
collab: {
item: 'style-old-collab'
},
ai: {
item: 'style-old-ai'
}
},
variant: {
list: {},
card: {
item: 'cursor-pointer items-start border border-(--ui-color-design-outline-na-stroke) bg-(--ui-color-design-outline-na-bg) has-data-[state=checked]:border-(--b24ui-border-color)'
},
table: {
item: 'cursor-pointer border border-(--ui-color-design-outline-na-stroke) bg-(--ui-color-design-outline-na-bg) has-data-[state=checked]:bg-(--b24ui-background)/24 has-data-[state=checked]:border-(--b24ui-border-color) has-data-[state=checked]:text-(--b24ui-color) has-data-[state=checked]:z-[1]'
}
},
size: {
xs: {
fieldset: 'gap-x-[12px] gap-y-[4px]',
legend: 'text-(length:--ui-font-size-xs)'
},
sm: {
fieldset: 'gap-x-[14px] gap-y-[6px]',
legend: 'text-(length:--ui-font-size-xs)'
},
md: {
fieldset: 'gap-x-[16px] gap-y-[8px]',
legend: 'text-(length:--ui-font-size-sm)'
},
lg: {
fieldset: 'gap-x-[16px] gap-y-[8px]',
legend: 'text-(length:--ui-font-size-sm)'
}
},
disabled: {
true: {}
},
required: {
true: {
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-color-accent-main-alert)"
}
}
},
compoundVariants: [
{
size: 'xs',
variant: 'card',
class: {
item: 'px-[13px] py-[7px] rounded-(--ui-border-radius-xs)'
}
},
{
size: 'sm',
variant: 'card',
class: {
item: 'px-[13px] py-[9px] rounded-(--ui-border-radius-sm)'
}
},
{
size: 'md',
variant: 'card',
class: {
item: 'px-[17px] py-[10px] rounded-(--ui-border-radius-md)'
}
},
{
size: 'lg',
variant: 'card',
class: {
item: 'px-[23px] py-[12px] rounded-(--ui-border-radius-md)'
}
},
{
size: 'xs',
variant: 'table',
class: {
item: 'px-[13px] py-[7px]'
}
},
{
size: 'sm',
variant: 'table',
class: {
item: 'px-[13px] py-[9px]'
}
},
{
size: 'md',
variant: 'table',
class: {
item: 'px-[17px] py-[10px]'
}
},
{
size: 'lg',
variant: 'table',
class: {
item: 'px-[23px] py-[12px]'
}
},
{
size: 'xs',
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-xs) last-of-type:rounded-e-(--ui-border-radius-xs)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: 'xs',
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-xs) last-of-type:rounded-b-(--ui-border-radius-xs)',
fieldset: 'gap-0 -space-y-px'
}
},
{
size: 'sm',
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-sm) last-of-type:rounded-e-(--ui-border-radius-sm)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: 'sm',
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-sm) last-of-type:rounded-b-(--ui-border-radius-sm)',
fieldset: 'gap-0 -space-y-px'
}
},
{
size: [
'lg',
'md'
],
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-md) last-of-type:rounded-e-(--ui-border-radius-md)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: [
'lg',
'md'
],
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)',
fieldset: 'gap-0 -space-y-px'
}
},
{
variant: 'table',
disabled: true,
class: {
item: 'cursor-not-allowed'
}
}
],
defaultVariants: {
size: 'md',
variant: 'list',
color: 'air-primary'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
checkboxGroup: {
slots: {
root: 'relative',
fieldset: 'flex gap-x-2',
legend: 'mb-1.5 block text-(--b24ui-typography-label-color)',
item: ''
},
variants: {
orientation: {
horizontal: {
fieldset: 'flex-row'
},
vertical: {
fieldset: 'flex-col'
}
},
color: {
'air-primary': {
item: 'style-filled'
},
'air-primary-success': {
item: 'style-filled-success'
},
'air-primary-alert': {
item: 'style-filled-alert'
},
'air-primary-copilot': {
item: 'style-filled-copilot'
},
'air-primary-warning': {
item: 'style-filled-warning'
},
default: {
item: 'style-old-default'
},
danger: {
item: 'style-old-danger'
},
success: {
item: 'style-old-success'
},
warning: {
item: 'style-old-warning'
},
primary: {
item: 'style-old-primary'
},
secondary: {
item: 'style-old-secondary'
},
collab: {
item: 'style-old-collab'
},
ai: {
item: 'style-old-ai'
}
},
variant: {
list: {},
card: {
item: 'cursor-pointer items-start border border-(--ui-color-design-outline-na-stroke) bg-(--ui-color-design-outline-na-bg) has-data-[state=checked]:border-(--b24ui-border-color)'
},
table: {
item: 'cursor-pointer border border-(--ui-color-design-outline-na-stroke) bg-(--ui-color-design-outline-na-bg) has-data-[state=checked]:bg-(--b24ui-background)/24 has-data-[state=checked]:border-(--b24ui-border-color) has-data-[state=checked]:text-(--b24ui-color) has-data-[state=checked]:z-[1]'
}
},
size: {
xs: {
fieldset: 'gap-x-[12px] gap-y-[4px]',
legend: 'text-(length:--ui-font-size-xs)'
},
sm: {
fieldset: 'gap-x-[14px] gap-y-[6px]',
legend: 'text-(length:--ui-font-size-xs)'
},
md: {
fieldset: 'gap-x-[16px] gap-y-[8px]',
legend: 'text-(length:--ui-font-size-sm)'
},
lg: {
fieldset: 'gap-x-[16px] gap-y-[8px]',
legend: 'text-(length:--ui-font-size-sm)'
}
},
disabled: {
true: {}
},
required: {
true: {
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-color-accent-main-alert)"
}
}
},
compoundVariants: [
{
size: 'xs',
variant: 'card',
class: {
item: 'px-[13px] py-[7px] rounded-(--ui-border-radius-xs)'
}
},
{
size: 'sm',
variant: 'card',
class: {
item: 'px-[13px] py-[9px] rounded-(--ui-border-radius-sm)'
}
},
{
size: 'md',
variant: 'card',
class: {
item: 'px-[17px] py-[10px] rounded-(--ui-border-radius-md)'
}
},
{
size: 'lg',
variant: 'card',
class: {
item: 'px-[23px] py-[12px] rounded-(--ui-border-radius-md)'
}
},
{
size: 'xs',
variant: 'table',
class: {
item: 'px-[13px] py-[7px]'
}
},
{
size: 'sm',
variant: 'table',
class: {
item: 'px-[13px] py-[9px]'
}
},
{
size: 'md',
variant: 'table',
class: {
item: 'px-[17px] py-[10px]'
}
},
{
size: 'lg',
variant: 'table',
class: {
item: 'px-[23px] py-[12px]'
}
},
{
size: 'xs',
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-xs) last-of-type:rounded-e-(--ui-border-radius-xs)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: 'xs',
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-xs) last-of-type:rounded-b-(--ui-border-radius-xs)',
fieldset: 'gap-0 -space-y-px'
}
},
{
size: 'sm',
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-sm) last-of-type:rounded-e-(--ui-border-radius-sm)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: 'sm',
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-sm) last-of-type:rounded-b-(--ui-border-radius-sm)',
fieldset: 'gap-0 -space-y-px'
}
},
{
size: [
'lg',
'md'
],
variant: 'table',
orientation: 'horizontal',
class: {
item: 'first-of-type:rounded-s-(--ui-border-radius-md) last-of-type:rounded-e-(--ui-border-radius-md)',
fieldset: 'gap-0 -space-x-px'
}
},
{
size: [
'lg',
'md'
],
variant: 'table',
orientation: 'vertical',
class: {
item: 'first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)',
fieldset: 'gap-0 -space-y-px'
}
},
{
variant: 'table',
disabled: true,
class: {
item: 'cursor-not-allowed'
}
}
],
defaultVariants: {
size: 'md',
variant: 'list',
color: 'air-primary'
}
}
}
})
]
})