Class: Shadcn::SpinnerComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::SpinnerComponent
- Defined in:
- app/components/shadcn/spinner_component.rb
Overview
Spinner component for loading states Matches shadcn/ui Spinner component
Constant Summary collapse
- SIZES =
{ sm: "h-4 w-4", default: "h-6 w-6", lg: "h-8 w-8", xl: "h-12 w-12" }.freeze
- BASE_CLASSES =
"animate-spin text-muted-foreground"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
-
#initialize(size: :default, **options) ⇒ SpinnerComponent
constructor
A new instance of SpinnerComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(size: :default, **options) ⇒ SpinnerComponent
Returns a new instance of SpinnerComponent.
28 29 30 31 |
# File 'app/components/shadcn/spinner_component.rb', line 28 def initialize(size: :default, **) super(**) @size = size.to_sym end |