View Source PetalComponents.Button (petal_components v1.9.2)

Summary

Functions

Attributes

  • size (:string) - button sizes. Defaults to "md".
  • variant (:string) - button variant. Defaults to "solid".
  • color (:string) - button color. Defaults to "primary".
  • to (:string) - link path. Defaults to nil.
  • loading (:boolean) - indicates a loading state. Defaults to false.
  • disabled (:boolean) - indicates a disabled state. Defaults to false.
  • icon (:atom) - name of a Heroicon at the front of the button. Defaults to nil.
  • with_icon (:boolean) - adds some icon base classes. Defaults to false.
  • link_type (:string) - Defaults to "button".
  • class (:string) - CSS class. Defaults to "".
  • label (:string) - labels your button. Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"].

Slots

  • inner_block

Attributes

  • size (:string) - Defaults to "sm".
  • color (:string) - Defaults to "gray".
  • to (:string) - link path. Defaults to nil.
  • loading (:boolean) - indicates a loading state. Defaults to false.
  • disabled (:boolean) - indicates a disabled state. Defaults to false.
  • with_icon (:boolean) - adds some icon base classes. Defaults to false.
  • link_type (:string) - Defaults to "button".
  • class (:string) - CSS class. Defaults to "".
  • tooltip (:string) - tooltip text. Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"].

Slots

  • inner_block

Functions

Attributes

  • size (:string) - button sizes. Defaults to "md".
  • variant (:string) - button variant. Defaults to "solid".
  • color (:string) - button color. Defaults to "primary".
  • to (:string) - link path. Defaults to nil.
  • loading (:boolean) - indicates a loading state. Defaults to false.
  • disabled (:boolean) - indicates a disabled state. Defaults to false.
  • icon (:atom) - name of a Heroicon at the front of the button. Defaults to nil.
  • with_icon (:boolean) - adds some icon base classes. Defaults to false.
  • link_type (:string) - Defaults to "button".
  • class (:string) - CSS class. Defaults to "".
  • label (:string) - labels your button. Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"].

Slots

  • inner_block

Attributes

  • size (:string) - Defaults to "sm".
  • color (:string) - Defaults to "gray".
  • to (:string) - link path. Defaults to nil.
  • loading (:boolean) - indicates a loading state. Defaults to false.
  • disabled (:boolean) - indicates a disabled state. Defaults to false.
  • with_icon (:boolean) - adds some icon base classes. Defaults to false.
  • link_type (:string) - Defaults to "button".
  • class (:string) - CSS class. Defaults to "".
  • tooltip (:string) - tooltip text. Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"].

Slots

  • inner_block