Checkbox Group
Installation
Run the following command
npx vibes@latest add checkbox-group
Usage
'use client';import { CheckboxGroup } from '@/vibes/soul/form/checkbox-group';import { useState } from 'react';function Usage() { const [value, setValue] = useState<string[]>([]); return ( <CheckboxGroup options={[ { label: 'Option 1', value: 'option-1' }, { label: 'Option 2', value: 'option-2' }, { label: 'Option 3', value: 'option-3' }, ]} value={value} onValueChange={setValue} /> );}
API Reference
CheckboxGroupProps
Prop | Type | Default |
---|---|---|
className | string | |
id | string | |
label | string | |
options* | Option[] | |
errors | string[] | |
name | string | |
value* | string[] | |
onValueChange* | (value: string[]) => void | |
colorScheme | 'light' | 'dark' | 'light' |
Option
Prop | Type | Default |
---|---|---|
value* | string | |
label* | string | |
disabled | boolean |