FloatingMenu.
Quick access, in just the right place.
Live preview
import { FloatingMenu } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<FloatingMenu
items={[
{ id: "home", label: "Home", href: "/" },
{ id: "settings", label: "Settings" },
]}
/>
);
}
Installation
npm install luminescent
Import luminescent/style.css once at your application root. The example above uses the same package implementation as Storybook.
Variants and states
Use the preview controls to explore the supported variants, sizes, disabled/loading states and reduced motion. Controls appear only where the component exposes the corresponding prop. Theme and glow apply to every component.
Controlled and uncontrolled state
State contract: activeId / defaultActiveId / onChange. Omit the controlled prop to let the component own its initial state; supply a value and callback when your application owns it. Native uncontrolled fields and state-backed form controls participate in form reset. Controlled state must be reset by the application.
import { useState } from "react";
import { FloatingMenu } from "luminescent";
export function ControlledExample() {
const [value, setValue] = useState("home");
return (
<FloatingMenu
activeId={value}
onChange={setValue}
items={[
{ id: "home", label: "Home" },
{ id: "settings", label: "Settings" },
]}
/>
);
}
API reference
Generated from the source TypeScript interfaces. Native attributes, className, style, aria-* and data-* also pass through to the documented element. Import FloatingMenuProps from the package for the full inherited contract.
| Prop | Type | Details |
|---|---|---|
glowColor | 'white' | 'peach' | Optional unless marked required. |
glowPosition | 'top' | 'bottom' | Optional unless marked required. |
items | FloatingMenuItem[] | Optional unless marked required. |
activeId | string | Optional unless marked required. |
defaultActiveId | string | Optional unless marked required. |
onChange | (id: string) => void | Optional unless marked required. |
withDivider | boolean | Optional unless marked required. |
Accessibility and keyboard
Links navigate; buttons perform actions. Native Tab/Enter/Space behavior, visible focus and aria-current/aria-pressed. Supply useful labels for every item, including icon items.
Keep labels meaningful and test application-level contrast, focus order and screen-reader output. See the accessibility guide for composition requirements.
Theme customization
import { LuminescentProvider, FloatingMenu } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<LuminescentProvider theme="light" accent="violet" glow="subtle">
<FloatingMenu
items={[
{ id: "home", label: "Home", href: "/" },
{ id: "settings", label: "Settings" },
]}
/>
</LuminescentProvider>
);
}
Switch between light and dark in the preview, or open the playground for a larger workspace. Custom CSS variables can override spacing, color, typography and effects.