Class: Shadcn::Spinner::Component
- Inherits:
-
Icon::Component
- Object
- ViewComponent::Base
- ApplicationViewComponent
- Icon::Component
- Shadcn::Spinner::Component
- Defined in:
- app/components/shadcn/spinner/component.rb
Overview
Port of registry/new-york-v4/ui/spinner.tsx — the lucide Loader2 icon with a status role.
Constant Summary
Constants inherited from Icon::Component
Icon::Component::SVG_ATTRIBUTES
Constants inherited from ApplicationViewComponent
ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS
Instance Attribute Summary
Attributes inherited from Icon::Component
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
- #css_classes(extra = nil) ⇒ Object
- #element_attributes(**defaults) ⇒ Object
-
#initialize(**attributes) ⇒ Component
constructor
A new instance of Component.
Methods inherited from Icon::Component
Methods inherited from ApplicationViewComponent
#call, default_tag, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name
Constructor Details
#initialize(**attributes) ⇒ Component
Returns a new instance of Component.
8 9 10 |
# File 'app/components/shadcn/spinner/component.rb', line 8 def initialize(**attributes) super("loader-2", **attributes) end |
Instance Method Details
#css_classes(extra = nil) ⇒ Object
16 17 18 |
# File 'app/components/shadcn/spinner/component.rb', line 16 def css_classes(extra = nil) super(ShadcnViewComponent.cn("size-4 animate-spin", extra)) end |
#element_attributes(**defaults) ⇒ Object
12 13 14 |
# File 'app/components/shadcn/spinner/component.rb', line 12 def element_attributes(**defaults) super(**{ role: "status", "aria-label" => shadcn_t("spinner.loading") }.merge(defaults)) end |