Renders a button.
Use this component when you need to perform an action such as submitting a form, confirming an action, deleting an item, toggling a setting, etc.
If you need to navigate to a different page or a specific section on the
current page and want to style the link like a button, use button_link/1
instead.
See also button_link/1
, toggle_button/1
, and disclosure_button/1
.
<.button>Confirm</.button>
<.button type=”submit”> Submit </.button>
To indicate a loading state, for example when submitting a form, use the
aria-busy
attribute:
<.button aria-label="Saving..." aria-busy>
click me
</.button>