Class: UI::SeparatorComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SeparatorComponent
- Includes:
- SeparatorBehavior
- Defined in:
- app/view_components/ui/separator_component.rb
Overview
Separator - ViewComponent implementation
Visually or semantically separates content. Uses SeparatorBehavior module for shared styling logic.
Based on shadcn/ui Separator: ui.shadcn.com/docs/components/separator Based on Radix UI Separator: www.radix-ui.com/primitives/docs/components/separator
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) ⇒ SeparatorComponent
constructor
A new instance of SeparatorComponent.
Methods included from SeparatorBehavior
#separator_classes, #separator_html_attributes
Constructor Details
#initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) ⇒ SeparatorComponent
Returns a new instance of SeparatorComponent.
17 18 19 20 21 22 |
# File 'app/view_components/ui/separator_component.rb', line 17 def initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) @orientation = orientation @decorative = decorative @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 |
# File 'app/view_components/ui/separator_component.rb', line 24 def call tag.div(**separator_html_attributes.deep_merge(@attributes)) end |