Navigation Menu
A list of links that allow users to navigate between pages of a website.
Structure
API Reference
The root navigation menu component which manages & scopes the state of the navigation menu.
Property | Type | Description |
---|---|---|
value $bindable | string | The value of the currently active menu. Default: undefined |
onValueChange | function | A callback function called when the active menu value changes. Default: undefined |
controlledValue | boolean | Whether or not the value is controlled or not. If Default: false |
dir | enum | The reading direction of the app. Default: ltr |
skipDelayDuration | number | How much time a user has to enter another trigger without incurring a delay again. Default: 300 |
delayDuration | number | The duration from when the mouse enters a trigger until the content opens. Default: 200 |
orientation | enum | The orientation of the menu. Default: horizontal |
ref $bindable | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
A menu within the menubar.
Property | Type | Description |
---|---|---|
ref $bindable | HTMLUListElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
A list item within the navigation menu.
Property | Type | Description |
---|---|---|
value | string | The value of the item. Default: undefined |
ref $bindable | HTMLLiElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
The button element which toggles the dropdown menu.
Property | Type | Description |
---|---|---|
disabled | boolean | Whether or not the trigger is disabled. Default: false |
ref $bindable | HTMLButtonElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
The content displayed when the dropdown menu is open.
Property | Type | Description |
---|---|---|
onInteractOutside | function | Callback fired when an outside interaction event completes, which is either a Default: undefined |
onFocusOutside | function | Callback fired when focus leaves the dismissible layer. You can call Default: undefined |
interactOutsideBehavior | enum | The behavior to use when an interaction occurs outside of the floating content. Default: close |
onEscapeKeydown | function | Callback fired when an escape keydown event occurs in the floating content. You can call Default: undefined |
escapeKeydownBehavior | enum | The behavior to use when an escape keydown event occurs in the floating content. Default: close |
forceMount | boolean | Whether or not to forcefully mount the content. This is useful if you want to use Svelte transitions or another animation library for the content. Default: false |
ref $bindable | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
A link within the navigation menu.
Property | Type | Description |
---|---|---|
active | boolean | Whether or not the link is active. Default: false |
onSelect | function | A callback function called when the link is selected. Default: undefined |
ref $bindable | HTMLAnchorElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
The viewport element for the navigation menu, which is used to contain the menu items.
Property | Type | Description |
---|---|---|
forceMount | boolean | Whether or not to forcefully mount the content. This is useful if you want to use Svelte transitions or another animation library for the content. Default: false |
ref $bindable | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |
The indicator element for the navigation menu, which is used to indicate the current active item.
Property | Type | Description |
---|---|---|
forceMount | boolean | Whether or not to forcefully mount the content. This is useful if you want to use Svelte transitions or another animation library for the content. Default: false |
ref $bindable | HTMLSpanElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
child | Snippet | Use render delegation to render your own element. See delegation docs for more information. Default: undefined |