Skip to main content

Switch

About 179 wordsLess than 1 minute

Switch (Toggle)

Props

PropTypeDefaultDescription
idstringAuto-generatedUnique ID for the toggle input.
iconstring | nullnullOptional icon to display beside the label.
labelstring-Text label shown beside the toggle.
infostring-Optional helper text shown below the toggle.
errorstring-Error message displayed below the toggle.
valueany-Value to emit when toggle is turned on (used in single or group mode).
uncheckedValueany-Value to emit when toggle is turned off (used in single mode).
modelValueany-The current value (can be boolean, value, or array of values).
disabledbooleanfalseWhether the toggle is disabled.

Emits

EventPayload TypeDescription
update:modelValueanyEmitted when the toggle is changed with the new value.

Install

import { FgSwitch } from 'fadgram-vue'

Basic usage

Preview

remember: false