npm install @fluix-ui/react @fluix-ui/css
import { Menu } from " @fluix-ui/react " ;
< Menu.Root orientation = " horizontal " variant = " pill " theme = " dark " >
< Menu.Item id = " home " > Home </ Menu.Item >
< Menu.Item id = " features " > Features </ Menu.Item >
< Menu.Item id = " pricing " > Pricing </ Menu.Item >
The Menu is a compound component with three parts: Menu.Root (container), Menu.Item (interactive items), and Menu.Indicator (animated active background).
spring = { { stiffness: 300 , damping: 25 , mass: 1 } }
< Menu.Item id = " home " > Home </ Menu.Item >
Prop Type Default Description orientation"vertical" | "horizontal""horizontal"Layout direction variant"pill" | "tab""pill"Visual style of the indicator themeMenuTheme"dark"Color theme activeIdstring | null— Controlled active item ID defaultActiveIdstring | null— Initial active item (uncontrolled) onActiveChange(id: string) => void— Called when active item changes springSpringConfigcore default Spring animation config roundnessnumber— Border radius factor blurnumber— Indicator blur amount fillstring— Background color override classNamestring— Custom class for the root element
< Menu.Item id = " home " disabled = { false } onClick = { () => console . log ( " clicked " ) } >
Prop Type Default Description idstringrequired Unique identifier for this item disabledbooleanfalseDisable interaction classNamestring— Custom class onClickMouseEventHandler— Click handler childrenReactNoderequired Item label content
< Menu.Indicator fill = " #3b82f6 " blur = { 10 } />
Prop Type Default Description fillstring— Indicator color override blurnumber— Blur amount override classNamestring— Custom class
import { useState } from " react " ;
import { Menu } from " @fluix-ui/react " ;
const [ active , setActive ] = useState ( " home " );
onActiveChange = { setActive }
< Menu.Item id = " home " > Home </ Menu.Item >
< Menu.Item id = " features " > Features </ Menu.Item >
< Menu.Item id = " pricing " > Pricing </ Menu.Item >
< Menu.Item id = " docs " > Docs </ Menu.Item >
< Menu.Root variant = " tab " orientation = " horizontal " theme = " dark " >
< Menu.Item id = " overview " > Overview </ Menu.Item >
< Menu.Item id = " analytics " > Analytics </ Menu.Item >
< Menu.Item id = " settings " > Settings </ Menu.Item >
< Menu.Root orientation = " vertical " variant = " pill " theme = " dark " >
< Menu.Item id = " dashboard " > Dashboard </ Menu.Item >
< Menu.Item id = " projects " > Projects </ Menu.Item >
< Menu.Item id = " team " > Team </ Menu.Item >
< Menu.Item id = " settings " > Settings </ Menu.Item >
Override the Menu CSS variables to customize the appearance:
--fluix-menu-bg : # 1a1a2e ;
--fluix-menu-color : # a0a0b0 ;
--fluix-menu-active-color : # ffffff ;
--fluix-menu-indicator : rgba ( 255 , 255 , 255 , 0.1 );