Forms
TwButton
TwButton is a Blazor button component. Use Variant, Color, StartIcon, EndIcon, Href, Disabled and IconButton, or group buttons horizontally or vertically.
Last updated
All Colors
Buttons support all color themes from the color palette:
Razor
@foreach (Color c in (Color[]) Enum.GetValues(typeof(Color)))
{
<TwButton Label="@c.ToString()" Color="@c" Class="m-1" />
}Theme Configuration
Styling is controlled by
TwBlazorTheme.Components (a TwButtonTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Inherited from TwButton - this component reuses that theme rather than defining its own.
| Property | Type | Controls |
|---|---|---|
ButtonRounded |
Rounded? | |
ButtonShadow |
Shadow? | |
DefaultVariant |
ButtonVariant? | |
ButtonUppercase |
bool | |
Uppercase |
string | |
Base |
string | |
Padding |
string | |
DensePadding |
string | |
IconButton |
string | |
Typography |
string | |
IconTypography |
string | |
DisabledCursor |
string | |
ReadonlyCursor |
string | |
DefaultCursor |
string | |
DisabledFilled |
string | |
DisabledOutlined |
string | |
DisabledText |
string |
Full reference: TwButtonTheme on the API docs.