Form Components

toggle-switch

Overview

The toggle-switch component is a UI component that allows users to toggle a switch. This component is used in the scheduling form to input toggle switch type inputs. Use it as a replacement for checkboxes when you want to present a switch in the UI.

Version1.1.0
Install (React)npm install @nylas/react
Import (React)import { ToggleSwitch } from '@nylas/react';

Properties

PropertyAttributeDescriptionTypeDefault
checkedcheckedThe default value of the toggle switch. This is the value that is displayed when the toggle switch is rendered.booleanfalse
labellabelThe label of the toggle switch. This is displayed next to the toggle switch.string''
namenameThe name of the toggle switch. This is used to identify the toggle switch when submitting a form.string'toggle-switch'

Events

EventDescriptionType
nylasFormSwitchToggledThis event is fired when the toggle switch is toggled.CustomEvent<{ checked: boolean; name: string; label: string; }>

Shadow Parts

PartDescription
"ts_input"The input of the toggle switch
"ts_label"The label of the toggle switch
"ts_slider"The slider of the toggle switch

Graph


Built with StencilJS