Class: Shadcn::NavigationMenuLinkComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::NavigationMenuLinkComponent
- Defined in:
- app/components/shadcn/navigation_menu_link_component.rb
Overview
A link within the navigation menu (for items without dropdowns)
Constant Summary collapse
- LINK_CLASSES =
[ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2", "text-sm font-medium transition-colors", "hover:bg-accent hover:text-accent-foreground", "focus:bg-accent focus:text-accent-foreground focus:outline-none", "disabled:pointer-events-none disabled:opacity-50" ].join(" ").freeze
- ACTIVE_CLASSES =
"bg-accent/50"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(href:, active: false, **options) ⇒ NavigationMenuLinkComponent
constructor
A new instance of NavigationMenuLinkComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(href:, active: false, **options) ⇒ NavigationMenuLinkComponent
Returns a new instance of NavigationMenuLinkComponent.
18 19 20 21 22 |
# File 'app/components/shadcn/navigation_menu_link_component.rb', line 18 def initialize(href:, active: false, **) super(**) @href = href @active = active end |
Instance Method Details
#call ⇒ Object
24 25 26 |
# File 'app/components/shadcn/navigation_menu_link_component.rb', line 24 def call content_tag(:a, content, link_attributes) end |