base-ui-svelte

Navigation Menu

A collection of links for site navigation.

View as Markdown

API Reference

Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.

NavigationMenu.Root

Extends HTML element attributes.

PropertyTypeDefaultDescription
valuestring | null | undefinedControlled value.
defaultValuestring | nullUncontrolled initial value.
onValueChange((value: string | null) => void) | undefinedEvent handler called when the value changes.
orientationNavigationMenuOrientation'horizontal'
delaynumber
closeDelaynumber
childrenSnippet<[{ value: string | null; open: boolean }]>Content rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.
data-orientationThe orientation of the component.

NavigationMenu.Arrow

Extends span HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

NavigationMenu.Backdrop

Extends div HTML attributes.

PropertyTypeDefaultDescription
renderstringHTML element tag to render instead of the default host element.
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

NavigationMenu.Content

Extends div HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

NavigationMenu.Icon

Extends span HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

NavigationMenu.Item

Extends HTML attributes for the rendered element.

PropertyTypeDefaultDescription
valuestringControlled value.
childrenSnippet<[{ open: boolean }]>Content rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

NavigationMenu.Link

Extends anchor HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

NavigationMenu.List

Extends HTML attributes for the rendered element.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-orientationThe orientation of the component.

NavigationMenu.Popup

Extends div HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-ending-stylePresent while the exit animation can run.
data-openPresent when the part is open.
data-starting-stylePresent while the enter animation can run.

NavigationMenu.Portal

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

NavigationMenu.Positioner

Extends div HTML attributes.

PropertyTypeDefaultDescription
sideSide
alignAlign
sideOffsetnumber
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

NavigationMenu.Trigger

Extends button HTML attributes.

PropertyTypeDefaultDescription
disabledbooleanfalseWhether the control ignores user interaction.
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-disabledPresent when the part is disabled.
data-openPresent when the part is open.

NavigationMenu.Viewport

Extends div HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.