Flow Kit LogoFlow Kit

Shared Menu

A flexible component that displays items in multiple layouts — list, card, and compact views with smooth animated transitions between them.

Preview

Anime Collection

Anime Collection

Visuals and characters

#1
Rick Ross

Rick Ross

American rapper

#2

Installation

npm install motion lucide-react

API Reference

SharedMenu

PropTypeDefaultDescription
itemsany[][]The list of items to display
children(item: any, index: number, viewType: ViewType) => ReactNodeRender function for each item
initialView"list" | "card" | "compact""list"The initial view mode
onViewChange(view: ViewType) => voidCallback when view changes
classNamestringAdditional CSS classes

Sub-components

  • SharedMenuItem: Base wrapper for an item (handles layoutId and provides context)
  • SharedMenuImage: Animated wrapper for images (shared across views)
  • SharedMenuContent: Animated wrapper for text content
  • SharedMenuNumber: Animated wrapper for labels or numbers

Features

  • Multiple View Types — Switch between List, Card, and Compact layouts
  • Smooth Animations — Items animate from position to position during view transitions with shared layout IDs
  • Responsive Design — Adapts to different screen sizes
  • Clean Transitions — No flickering, smooth height and position animations