Class: Shadcn::Button::Preview
- Inherits:
-
ApplicationViewComponentPreview
- Object
- ViewComponentContrib::Preview::Base
- ApplicationViewComponentPreview
- Shadcn::Button::Preview
- Defined in:
- app/components/shadcn/button/preview.rb
Instance Method Summary collapse
-
#as_link ⇒ Object
as:is the equivalent of shadcn'sasChild. - #default ⇒ Object
- #playground(variant: :default, size: :default, disabled: false) ⇒ Object
- #sizes ⇒ Object
- #variants ⇒ Object
Instance Method Details
#as_link ⇒ Object
as: is the equivalent of shadcn's asChild.
26 27 28 |
# File 'app/components/shadcn/button/preview.rb', line 26 def as_link render_component(as: :a, href: "#", variant: :link) { "A link that looks like a button" } end |
#default ⇒ Object
6 7 8 |
# File 'app/components/shadcn/button/preview.rb', line 6 def default render_with_template end |
#playground(variant: :default, size: :default, disabled: false) ⇒ Object
13 14 15 |
# File 'app/components/shadcn/button/preview.rb', line 13 def playground(variant: :default, size: :default, disabled: false) render_component(variant:, size:, disabled:) { "Button" } end |
#sizes ⇒ Object
21 22 23 |
# File 'app/components/shadcn/button/preview.rb', line 21 def sizes render_with_template end |
#variants ⇒ Object
17 18 19 |
# File 'app/components/shadcn/button/preview.rb', line 17 def variants render_with_template end |