SurfaceBulma.Button (surface_bulma v0.3.3)

The classic button, in different colors, sizes, and states

Properties

  • type :string, default: "button" - The button type, defaults to "button", mainly used for instances like modal X to close style buttons where you don't want to set a type at all. Setting to nil makes button have no type.

  • label :string - The label of the button, when no content (default slot) is provided

  • aria_label :string - The aria label for the button

  • color :string, values: ~w(white black light dark primary link info success warning danger) - The color of the button.

  • size :string, values: ~w(small normal medium large) - The vertical size of button

  • link :boolean - Is link?

  • value :string - The value for the button

  • expand :boolean - Button is expanded (full-width)

  • disabled :boolean - Set the button as disabled preventing the user from interacting with the control

  • outlined :boolean - Outlined style

  • rounded :boolean - Rounded style

  • hovered :boolean - Hovered style

  • focused :boolean - Focused style

  • active :boolean - Active style

  • selected :boolean - Selected style

  • static :boolean - Static style

  • loading :boolean - Loading state

  • class :css_class, default: [] - Css classes to propagate down to button. Default class if no class supplied is simply button

  • opts :keyword, default: [] - Additional attributes to add onto the generated element

  • addon :boolean, default: false - Whether or not this button is used as an addon to a form field.

Slots

  • default - The content of the generated <button> element. If no content is provided, the value of property label is used instead.

Events

  • click - Triggered on click

Link to this section Summary

Link to this section Functions

Link to this function

render(assigns)

Callback implementation for Surface.Component.render/1.

Link to this function

render_button(assigns)