Toggle switch gives control over a feature or option that can be turned on or off. If a physical switch would work for the action, a toggle is probably the best component to use.
<nord-toggle checked label="Checked toggle" value="Value"></nord-toggle>
<nord-toggle label="Unchecked" value="Value"></nord-toggle>
Controls whether the toggle is checked or not.
Controls whether the contents are displayed in reverse order, putting the label before the toggle.
The size of the toggle switch.
Label for the input.
Optional hint text to be displayed with the input. Alternatively use the hint slot.
Visually hide the label, but still show it to assistive technologies like screen readers.
Placeholder text to display within the input.
Optional error to be shown with the input. Alternatively use the error slot.
Determines whether the input is required or not. An input marked as required will be announced as such to users of assistive technology. When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.
Visually hide the required indicator, but still show required attribute to assistive technologies like screen readers.
Makes the component disabled. This prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.
The name of the form component.
The value of the form component.
Gets the form, if any, associated with the form element.
Fired as the user types into the input.
Fired whenever the input's value is changed via user interaction.
|Use when a label requires more than plain text.|
|Optional slot that holds hint text for the input.|
|Optional slot that holds error text for the input.|
Programmatically move focus to the component.
Programmatically remove focus from the component.
Programmatically simulates a click on the component.
This section includes guidelines for designers and developers about the usage of this component in different contexts.
- Use toggles when your intent is to turn something on or off instantly.
- Use for any feature or option that can be turned on or off.
- If a physical switch would work for the action, the toggle is probably the best component to use.
- Use for making it possible to choose one or more options from a limited number of options.
- Toggles should never require users to click a button to apply or save the setting.
- Avoid using when you have more than 10 options to choose from.
- Don’t change the selection of another toggle when another one is clicked. Only exception is when a toggle is used to make a bulk selection of multiple items.
Content guidelines #
Toggle labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:
When writing toggle labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):
Avoid ending in punctuation if it’s a single sentence, word, or a fragment:
Do not use commas or semicolons at the end of each line
If you experience any issues while using Nord Web Components, please head over to the Support page for more guidelines and ways to contact us.