Displays a button or a component that looks like a button.
Installation
Usage
<Button Variant="ButtonVariant.Outline">Button</Button>Cursor
Tailwind v4 switched from cursor: pointer to cursor: default for the button component.
If you want to keep the cursor: pointer behavior, add the following code to your CSS file:
@layer base {
button:not(:disabled),
[role="button"]:not(:disabled) {
cursor: pointer;
}
}Size
Use the Size parameter to change the size of the button.
Default
Outline
Secondary
Ghost
Destructive
Link
Icon
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.
Button Group
To create a button group, use the ButtonGroup component. See the Button Group documentation for more details.
As Link
You can use the ButtonVariants.Get helper to make a link look like a button.
Do not render a Button as an <a> for links. A Button that renders anything but a <button> gets role="button", which overrides the link role of <a>. Use ButtonVariants.Get on a plain <a> tag instead.
RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.
API Reference
Button
Other attributes are passed to the element it renders.
Changelog
2026-11-25 Button type
Type is now a ButtonType enum instead of a string: ButtonType.Button (the default),
ButtonType.Submit, or ButtonType.Reset. A Button with no Type now renders
type="button", so inside a form it no longer submits. Give the submit button Type="ButtonType.Submit".
Trigger attributes (context.Attributes) carry the same enum, so spreading them onto a Button still works.
AlertDialogAction, AttachmentAction, CalendarDayButton, CarouselNext,
CarouselPrevious, CodeBlockCopyButton, InputGroupButton and SidebarTrigger take
Type too. Update the Blazix.Primitives package, then re-add the components you use with
dnx Blazix.Cli add <name> --overwrite.