Class: UI::Separator
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::Separator
- Includes:
- SeparatorBehavior
- Defined in:
- app/components/ui/separator.rb
Overview
Separator - Phlex implementation
Visually or semantically separates content. Uses SeparatorBehavior module for shared styling logic.
Based on shadcn/ui Separator: https://ui.shadcn.com/docs/components/separator Based on Radix UI Separator: https://www.radix-ui.com/primitives/docs/components/separator
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) ⇒ Separator
constructor
A new instance of Separator.
- #view_template ⇒ Object
Methods included from SeparatorBehavior
#separator_classes, #separator_html_attributes
Constructor Details
#initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) ⇒ Separator
Returns a new instance of Separator.
29 30 31 32 33 34 |
# File 'app/components/ui/separator.rb', line 29 def initialize(orientation: :horizontal, decorative: true, classes: "", **attributes) @orientation = orientation @decorative = decorative @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
36 37 38 |
# File 'app/components/ui/separator.rb', line 36 def view_template div(**separator_html_attributes.deep_merge(@attributes)) end |