Skip to content

Menu — API Reference

The Menu is a compound component with three parts:

PartDescription
Menu.RootContainer that manages layout, state, and theming
Menu.IndicatorAnimated background that morphs between active items using spring physics and SVG gooey effect. Rendered automatically inside Menu.Root — you usually don’t need to include it manually.
Menu.ItemIndividual interactive navigation item
PropTypeDefaultDescription
orientationMenuOrientation"horizontal"Layout direction of the menu items
variantMenuVariant"pill"Visual style of the active indicator
themeMenuTheme"dark"Color theme
activeIdstring | nullControlled active item ID. Use with onActiveChange for controlled state.
defaultActiveIdstring | nullInitial active item for uncontrolled usage
onActiveChange(id: string) => voidCallback when the active item changes (React/Svelte). Vue uses @active-change, Angular uses (activeChange).
springSpringConfigcore defaultSpring physics configuration for the indicator animation
roundnessnumberBorder radius factor for the indicator
blurnumberGooey blur amount for the indicator
fillstringColor override applied to the menu background and the active indicator. Prefer this over manually styling Menu.Indicator.
classNamestringCustom CSS class for the root element
PropTypeDefaultDescription
idstringrequiredUnique identifier for this item. Used to track the active state.
disabledbooleanfalseDisables interaction and dims the item
classNamestringCustom CSS class
onClickMouseEventHandlerClick handler (in addition to the active state change)
childrenReactNoderequiredLabel content rendered inside the item
PropTypeDefaultDescription
fillstringOverride the indicator background color
blurnumberOverride the gooey blur amount
classNamestringCustom CSS class
import { Menu } from "@fluix-ui/react";
import "@fluix-ui/css";
function App() {
const [active, setActive] = useState("home");
return (
<Menu.Root
orientation="horizontal"
variant="pill"
theme="dark"
activeId={active}
onActiveChange={setActive}
>
<Menu.Item id="home">Home</Menu.Item>
<Menu.Item id="features">Features</Menu.Item>
</Menu.Root>
);
}

Uses compound components. State change callback via onActiveChange prop.

<script setup>
import { ref } from "vue";
import { Menu } from "@fluix-ui/vue";
import "@fluix-ui/css";
const active = ref("home");
</script>
<template>
<Menu.Root
orientation="horizontal"
variant="pill"
theme="dark"
:activeId="active"
@active-change="active = $event"
>
<Menu.Item id="home">Home</Menu.Item>
<Menu.Item id="features">Features</Menu.Item>
</Menu.Root>
</template>
EventPayloadDescription
@active-changestringEmitted when the active item changes
<script>
import { Menu } from "@fluix-ui/svelte";
import "@fluix-ui/css";
let active = $state("home");
</script>
<Menu.Root
orientation="horizontal"
variant="pill"
theme="dark"
activeId={active}
onActiveChange={(id) => active = id}
>
<Menu.Item id="home">Home</Menu.Item>
<Menu.Item id="features">Features</Menu.Item>
</Menu.Root>

Uses Svelte 5 runes ($state). State change callback via onActiveChange prop.

import { Component } from "@angular/core";
import { FluixMenuComponent } from "@fluix-ui/angular";
import "@fluix-ui/css";
@Component({
standalone: true,
imports: [FluixMenuComponent],
template: `
<fluix-menu
orientation="horizontal"
variant="pill"
theme="dark"
[activeId]="active"
(activeChange)="active = $event"
>
<fluix-menu-item menuId="home">Home</fluix-menu-item>
<fluix-menu-item menuId="features">Features</fluix-menu-item>
</fluix-menu>
`,
})
export class AppComponent {
active = "home";
}
NameTypeDescription
orientation"vertical" | "horizontal"Layout direction
variant"pill" | "tab"Visual style
themeMenuThemeColor theme
activeIdstring | nullControlled active item
springSpringConfigPhysics config
roundnessnumberBorder radius factor
blurnumberIndicator blur
fillstringBackground override
activeChangeEventEmitter<string>Active item change event

The Vanilla adapter uses a factory function instead of components.

ParameterTypeDescription
hostHTMLElementDOM element to mount the menu into
optionsMenuOptionsConfiguration object (see below)
OptionTypeDescription
orientationMenuOrientationLayout direction
variantMenuVariantVisual style
themeMenuThemeColor theme
itemsArray<{ id: string; label: string; disabled?: boolean }>Menu items to render
activeIdstring | nullInitial active item
springSpringConfigPhysics configuration
roundnessnumberBorder radius factor
blurnumberIndicator blur
fillstringBackground override
onActiveChange(id: string) => voidActive change callback
MethodSignatureDescription
setActive(id: string) => voidProgrammatically set the active item
getActive() => string | nullGet the current active item ID
update(options: Partial<MenuOptions>) => voidUpdate menu configuration
destroy() => voidRemove the menu and clean up event listeners
import { createMenu } from "@fluix-ui/vanilla";
import "@fluix-ui/css";
const menu = createMenu(document.getElementById("nav"), {
orientation: "horizontal",
variant: "tab",
theme: "dark",
items: [
{ id: "overview", label: "Overview" },
{ id: "analytics", label: "Analytics" },
{ id: "settings", label: "Settings" },
],
onActiveChange: (id) => {
console.log("Active tab:", id);
},
});
// Programmatic control
menu.setActive("analytics");
// Cleanup
menu.destroy();
type MenuOrientation = "horizontal" | "vertical";
type MenuVariant = "pill" | "tab";
  • pill — Rounded background indicator that slides behind the active item.
  • tab — Underline-style indicator below (horizontal) or beside (vertical) the active item.
type MenuTheme = "dark" | "light" | string;

Accepts "dark", "light", or any custom string. Custom strings map to CSS attribute selectors — see Theming.

interface SpringConfig {
stiffness?: number;
damping?: number;
mass?: number;
}

Controls the spring physics of the indicator animation. Higher stiffness makes it snappier, higher damping reduces oscillation, higher mass makes it heavier/slower.

Override these on [data-fluix-menu] to customize the appearance:

VariableDefaultDescription
--fluix-menu-bg#1a1a2eMenu container background
--fluix-menu-color#a0a0b0Inactive item text color
--fluix-menu-active-color#ffffffActive item text color
--fluix-menu-indicatorrgba(255, 255, 255, 0.1)Indicator fill color
[data-fluix-menu] {
--fluix-menu-bg: #0f172a;
--fluix-menu-color: #94a3b8;
--fluix-menu-active-color: #f1f5f9;
--fluix-menu-indicator: rgba(99, 102, 241, 0.2);
}
  • Each Menu.Item renders a button element with appropriate focus management.
  • Keyboard navigation with arrow keys moves focus between items.
  • The active indicator is purely decorative and hidden from assistive technology.
  • Disabled items are skipped during keyboard navigation.