SurfaceBootstrap.Button (surface_bootstrap v0.2.5)

A Button element as defined by https://getbootstrap.com/docs/5.0/components/buttons/

Properties

  • aria_disabled :boolean - Aria disabled, is set to true automatically if component has 'disabled' prop and it is true. .
  • aria_label :string - Aria label, automatically set to label, if prop exists. Explicitly set to nil if this behaviour is unwanted. .
  • aria_hidden :boolean - Aria hidden, automatically set to true if 'inivisble' prop is set. .
  • 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.
  • color :string, values: @button_colors - The color of the button.
  • size :string, values: @button_sizes - The size of button, setting nothing equals normal size.
  • value :string - The value for the button.
  • values :keyword, default: [] - Add multiple named values, translates to phx-value-<name> .
  • disabled :boolean - Set the button as disabled preventing the user from interacting with the control.
  • outlined :boolean - Outlined style.
  • rounded :boolean - Rounded pill style.
  • loading :boolean - Loading state.
  • loading_text :string - Text to display on button while loading, overwrites label while loading..
  • loading_label :boolean, default: true - Should the label show when button is loading? Defaults to true..
  • title :string - Title prop.
  • class :css_class, default: [] - Css classes to propagate down to button. Default class if no class supplied is simply btn.
  • opts :keyword, default: [] - Add arbitrary attrs like multiple phx-value-* fields.

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

Callback implementation for Phoenix.LiveComponent.mount/1.

Link to this function

render(assigns)

Callback implementation for Phoenix.LiveComponent.render/1.

Link to this function

update(assigns, socket)

Callback implementation for Phoenix.LiveComponent.update/2.