NavToggle
Nav toggle is meant for hiding and showing the primary navigation. This component is used internally in the Layout component, but can also be used separate to further customize the behavior.
Methods
| Method name | Parameters | Description |
|---|---|---|
focus(options?: FocusOptions) => void | options: An object which controls aspects of the focusing process. | Programmatically move focus to the component. |
blur() => void | N/A | Programmatically remove focus from the component. |
click() => void | N/A | Programmatically simulates a click on the component. |
Dependencies
This component is internally dependent on the following components:
- <nord-button>
Button
Buttons are used for interface actions. Primary style should be used only once per section for main call-to-action, while other styles can appear more frequently.
- <nord-icon>
Icon
Icons are used to provide additional meaning or in places where text label doesn’t fit. Icon component allows you to display an icon from the Nordicons library.
- <nord-visually-hidden>
VisuallyHidden
Visually hidden is used when an element needs to be available to assistive technologies like screen readers, but be otherwise hidden.
Usage
This section includes guidelines for designers and developers about the usage of this component in different contexts.
Do
- Use a tooltip with the toggle that’s labelled as
Toggle navigation. - We recommend setting a keyboard shortcut that toggles the navigation.
Don’t
- Don’t use as a generic button or toggle. Use the Button component instead.
Integration
For integration guidelines, please see Web Components documentation .