Skip to main content
Tw Twintrinsic
  • Getting Started
  • Components
  • Theming
  • Completion
Examples
Data Dashboard Game Map
Core
App
Layout
Accordion AccordionItem Card Container Panel Separator Sidebar Splitter
Navigation
AppHeader BottomBar Breadcrumb BreadcrumbItem Menu MenuItem Tabs Tab TabList TabPanel TreeMenu
Data Display
Avatar AvatarGroup Badge Carousel CarouselItem Chip ChipGroup CodeBlock CodeBlockSpeed CodeEditor DataTable Map Progress Skeleton Table TableBody TableCell TableHead TableHeader TableRow Tag TagGroup Timeline TimelineItem Tooltip Tree TreeNode
Metrics
DonutChart PieChart LineChart BarChart HorizontalBarChart AreaChart StatsCard MetricGrid KPICard GaugeChart ProgressMetric MetricTrend
Form
AutoComplete Button ButtonGroup Calendar Checkbox ColorPicker Combobox Dropdown FileUpload FloatLabel Form FormField Input InputSwitch InvalidState Knob ListInput Listbox NumberInput Radio RadioGroup Rating Select SelectGroup Slider Switch TextInput Textarea
Feedback
Modal Stepper StepperStep Toast
Utility
Icon Lazy LazyPanel Masonry ThemeToggle

MenuItem

The MenuItem component represents individual items within a Menu. It supports links, buttons, active states, disabled states, and nested submenus.

Examples

Basic Menu Items

Menu items can be used as links or buttons:

Active State

Use the active prop to highlight the current menu item:

Disabled State

Use the disabled prop to disable interaction:

With Submenu

Menu items can have nested submenus using the value prop with a children array:

Props

PropTypeDefaultDescription
hrefstring'#'Link href. If provided, renders as an anchor tag; otherwise renders as a button.
activebooleanfalseWhether the menu item is currently active
disabledbooleanfalseWhether the menu item is disabled
initialOpenbooleanfalseWhether the submenu is initially open
ariaLabelstring''ARIA label for accessibility
idstringcrypto.randomUUID()HTML id for accessibility
classstring''Additional CSS classes
valueany{}Value associated with this menu item. Can include a children array for submenus.

Slots

MenuItem accepts a default slot for custom content:

  • default - The content of the menu item

Features

  • Flexible rendering as link or button based on href prop
  • Active and disabled states
  • Nested submenu support
  • Full keyboard navigation support
  • ARIA labels for accessibility
  • Responsive design
  • Dark mode support

Accessibility

  • Semantic HTML with proper role attributes
  • ARIA labels for screen readers
  • Keyboard navigation support
  • Proper disabled state handling
  • Focus management for submenus