Class: Shadcn::Sidebar::Separator::Component

Inherits:
Shadcn::Separator::Component show all
Defined in:
app/components/shadcn/sidebar/separator/component.rb

Overview

SidebarSeparator — the ported Separator, restamped and tinted to the sidebar's own border colour.

Constant Summary collapse

EXTRA_CLASSES =
"mx-2 w-auto bg-sidebar-border"

Constants inherited from ApplicationViewComponent

ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS

Instance Attribute Summary

Attributes inherited from Shadcn::Separator::Component

#decorative, #orientation

Attributes inherited from ApplicationViewComponent

#attributes

Instance Method Summary collapse

Methods inherited from Shadcn::Separator::Component

#initialize

Methods inherited from ApplicationViewComponent

#call, default_tag, #initialize, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name

Constructor Details

This class inherits a constructor from Shadcn::Separator::Component

Instance Method Details

#css_classes(extra = nil) ⇒ Object



13
14
15
# File 'app/components/shadcn/sidebar/separator/component.rb', line 13

def css_classes(extra = nil)
  super([ EXTRA_CLASSES, extra ].compact.join(" "))
end

#element_attributes(**defaults) ⇒ Object



17
18
19
# File 'app/components/shadcn/sidebar/separator/component.rb', line 17

def element_attributes(**defaults)
  super(**{ "data-sidebar" => "separator" }.merge(defaults))
end