Button
Displays a button or a component that looks like a button.
Installation
Copy the following code into your app directory.
Command
Command
Manual
Manual
uv
Anatomy
Use the following composition to build a Button component.
With Icon
Remember to add the data-icon="inline-start" or data-icon="inline-end" attribute to the icon for the correct spacing.
Rounded
Use the rounded-full class to make the button rounded.
Spinner
Render a spinner() component inside the button to show a loading state. Remember to add the data-icon="inline-start" or data-icon="inline-end" attribute to the spinner for the correct spacing.
As Link
You can use the button_variants helper function to make a link look like a button.
Do not use button(rx.el.a(...)) for links. The Base UI Button component always applies role="button", which overrides the semantic link role on <a> elements. Use button_variants with a plain rx.el.a tag instead to cleanly generate the necessary classes as a dynamic Reflex Var.
API Reference
Button
The Button component is a wrapper around the button element that adds a variety of styles and functionality.