Class: Solidstats::Previews::ActionButtonComponentPreview
- Inherits:
-
ViewComponent::Preview
- Object
- ViewComponent::Preview
- Solidstats::Previews::ActionButtonComponentPreview
- Defined in:
- app/components/solidstats/previews/action_button_component_preview.rb
Overview
Preview for ActionButtonComponent
Instance Method Summary collapse
-
#button_vs_link ⇒ Object
As buttons vs links.
-
#default ⇒ Object
Default action button.
-
#sizes ⇒ Object
Different sizes.
-
#variants ⇒ Object
Different variants.
-
#with_icons ⇒ Object
With icons.
Instance Method Details
#button_vs_link ⇒ Object
As buttons vs links
53 54 55 56 57 58 59 60 61 |
# File 'app/components/solidstats/previews/action_button_component_preview.rb', line 53 def render_with_template(locals: { elements: [ { text: "Link Button", href: "#", variant: :primary }, { text: "Submit Button", variant: :primary, type: "submit" }, { text: "Regular Button", variant: :secondary, type: "button" } ] }) end |
#default ⇒ Object
Default action button
8 9 10 11 12 13 14 |
# File 'app/components/solidstats/previews/action_button_component_preview.rb', line 8 def default render(Solidstats::Ui::ActionButtonComponent.new( text: "Click Me", href: "#", variant: :primary )) end |
#sizes ⇒ Object
Different sizes
30 31 32 33 34 35 36 37 38 |
# File 'app/components/solidstats/previews/action_button_component_preview.rb', line 30 def sizes render_with_template(locals: { buttons: [ { text: "Small", href: "#", variant: :primary, size: :small }, { text: "Medium", href: "#", variant: :primary, size: :medium }, { text: "Large", href: "#", variant: :primary, size: :large } ] }) end |
#variants ⇒ Object
Different variants
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/components/solidstats/previews/action_button_component_preview.rb', line 17 def variants render_with_template(locals: { buttons: [ { text: "Primary", href: "#", variant: :primary }, { text: "Secondary", href: "#", variant: :secondary }, { text: "Outline", href: "#", variant: :outline }, { text: "Ghost", href: "#", variant: :ghost }, { text: "Danger", href: "#", variant: :danger } ] }) end |
#with_icons ⇒ Object
With icons
41 42 43 44 45 46 47 48 49 50 |
# File 'app/components/solidstats/previews/action_button_component_preview.rb', line 41 def with_icons render_with_template(locals: { buttons: [ { text: "Download", href: "#", variant: :primary, icon: "⬇" }, { text: "Edit", href: "#", variant: :secondary, icon: "✏" }, { text: "Delete", href: "#", variant: :danger, icon: "🗑" }, { text: "Refresh", href: "#", variant: :outline, icon: "🔄" } ] }) end |