Skip to content

Switch

Last updated 6 Nov 2026

NbSwitch is a toggle control that represents an on/off binary state. It supports labels, sizes, variants, and a verbose mode that shows the current state as text.

A label only for assistive technology ​

Every switch needs a label, because it is the input's accessible name. When the row around the switch already says what it controls, for example a list of panels each with its own title, set hide-label: the label stays the switch's name for a screen reader but is not shown.

vue
<NbSwitch v-model="shown" name="panel-goals" label="Show Goals" hide-label />

Props ​

PropTypeDefaultDescription
modelValuebooleanfalseCurrent state (v-model)
namestringrequiredNative name attribute
labelstring-Label text shown beside the toggle
size'sm' | 'md' | 'lg''md'Toggle size
variant'primary' | 'secondary''primary'Color variant for the active state
verbosebooleanfalseShow On / Off state text
disabledbooleanfalseDisable the toggle

Events ​

EventPayloadDescription
update:modelValuebooleanEmitted when the toggle is clicked