Class: Shadcn::Item::Separator::Component
- Inherits:
-
Separator::Component
- Object
- ViewComponent::Base
- ApplicationViewComponent
- Separator::Component
- Shadcn::Item::Separator::Component
- Defined in:
- app/components/shadcn/item/separator/component.rb
Overview
ItemSeparator renders a Separator with its own data-slot and one class
on top, the way ButtonGroupSeparator does. Upstream pins the orientation
to horizontal rather than defaulting it, so it is not a keyword here.
Constant Summary collapse
- EXTRA_CLASSES =
"my-0"
Constants inherited from ApplicationViewComponent
ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS
Instance Attribute Summary
Attributes inherited from Separator::Component
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
- #css_classes(extra = nil) ⇒ Object
-
#initialize(**attributes) ⇒ Component
constructor
A new instance of Component.
Methods inherited from Separator::Component
Methods inherited from ApplicationViewComponent
#call, default_tag, #element_attributes, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name
Constructor Details
#initialize(**attributes) ⇒ Component
Returns a new instance of Component.
14 15 16 |
# File 'app/components/shadcn/item/separator/component.rb', line 14 def initialize(**attributes) super(orientation: :horizontal, **attributes) end |
Instance Method Details
#css_classes(extra = nil) ⇒ Object
18 19 20 |
# File 'app/components/shadcn/item/separator/component.rb', line 18 def css_classes(extra = nil) super([ EXTRA_CLASSES, extra ].compact.join(" ")) end |