fun-toggle

For turning things on and off. Similiar to a checkbox, but changes should be immediate. It won’t just be selecting an option (like with a checkbox) but the selection will also be submitted instantly.

Note that this component does not manage it’s own ‘checked’ state. You will need to listen to the funChange event and change the checked state yourself.

Accessibility

The toggle must have a tooltip describing what’s being toggled. Use the tooltip attribute to set this description, the tooltip will be used as label for screen readers.

Examples

Specifications

Properties

PropertyAttributeRequiredDescriptionTypeDefault
checkedcheckedfalseIf the toggle is checked or not.boolean
disableddisabledfalseDisabled toggles cannot be changed.booleanfalse
namenametrueThe name of this input.string
sizesizefalseSize"large" | "regular"'regular'
tooltiptooltiptrueA describing text for the toggle, will be used as label for screen readersstring

Events

NameDescription
funChangeEmitted when the control is toggled.

Dependencies

Depends on

This documentation page generated from the source at fun-toggle.tsx

Search Gunnel

Powered byAlgolia