Fan View

Use Fan View for a short set of visual choices that can open from one trigger. Its cards spread into a fanned layout and collapse after selection, outside interaction, or Escape.

Preview

Reduce motion:Off
Tune:Off
Inspect

Installation

Basic usage

TypeScript
fan-menu.tsx

Examples

Pass controlled open state when the menu is coordinated with another view. Keep the item count small so each card remains readable in the fan.

Usage

API

PropertyTypeDefaultDescription
itemsFanViewItem[]—Items displayed as fanned cards when open.
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => void—Called when the view opens or closes.
stiffnessnumber540Spring stiffness for the fan animation.
dampingnumber28Spring damping for the fan animation.
classNamestring—Additional CSS classes for the root container.

Accessibility

Escape closes the view and restores focus to the trigger. Give each card a short label and ensure its action is available without relying on the animation.

Styling

Adjust card content, widths, and motion options to fit the context. Reduced-motion preferences remove the fanning movement.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.