Navigation Menu
Navigation whose triggers reveal content panels, one at a time.
Installation
Shadwire follows shadcn/ui's open code model: the component's source is copied into your application and becomes yours. Install it with the CLI:
The navigation-menu registry item installs these files:
-
app/components/ui_component.rb -
app/components/ui/navigation_menu_component.rb -
app/components/ui/navigation_menu/list_component.rb -
app/components/ui/navigation_menu/item_component.rb -
app/components/ui/navigation_menu/trigger_component.rb -
app/components/ui/navigation_menu/content_component.rb -
app/components/ui/navigation_menu/link_component.rb -
app/components/ui/icon_component.rb -
app/helpers/ui/navigation_menu_helper.rb -
app/helpers/ui/icon_helper.rb -
app/javascript/controllers/ui_navigation_menu_controller.js -
vendor/shadwire/shadwire.css
This component uses Stimulus, so the application needs importmap-rails and stimulus-rails with automatic controller loading.
Haven't installed the CLI yet? gem install shadwire, then shadwire init.
Usage
Examples
API reference
Every part accepts class / class_name and **attrs.
| Component | Argument | Default | Description |
|---|---|---|---|
NavigationMenu::Link |
active |
false |
Marks the current page: sets aria-current="page" and data-active. |