Switch
About 179 wordsLess than 1 minute
Switch (Toggle)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | Auto-generated | Unique ID for the toggle input. |
icon | string | null | null | Optional icon to display beside the label. |
label | string | - | Text label shown beside the toggle. |
info | string | - | Optional helper text shown below the toggle. |
error | string | - | Error message displayed below the toggle. |
value | any | - | Value to emit when toggle is turned on (used in single or group mode). |
uncheckedValue | any | - | Value to emit when toggle is turned off (used in single mode). |
modelValue | any | - | The current value (can be boolean, value, or array of values). |
disabled | boolean | false | Whether the toggle is disabled. |
Emits
| Event | Payload Type | Description |
|---|---|---|
update:modelValue | any | Emitted when the toggle is changed with the new value. |
Install
import { FgSwitch } from 'fadgram-vue'
Basic usage
Preview
remember: false
vue
<fg-switch v-model="remember" label="Remember Me." />
