No results
1
Button
Byron edited this page 2026-10-02 22:18:39 +02:00
Table of contents
Simple usage
<CleanButton onclick="alert('Hello world!')">
Click me!
</CleanButton>
<CleanButton PrefixContent="@(Icons.Burger)" onclick="alert('Hello world!')">
This button has an icon.
</CleanButton>
<CleanButton onclick="alert('Hello world!')" disabled>
This button is disabled.
</CleanButton>
Types
<CleanButton>
Default
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Primary)">
Primary
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Secondary)">
Secondary
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Danger)">
Danger
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Link)">
Link
</CleanButton>
Sizes
<CleanButton Size="@(CleanButtonSize.ExtraSmall)">
Extra small
</CleanButton>
<CleanButton Size="@(CleanButtonSize.Small)">
Small
</CleanButton>
<CleanButton>
Default (medium)
</CleanButton>
<CleanButton Size="@(CleanButtonSize.Large)">
Large
</CleanButton>
<CleanButton Size="@(CleanButtonSize.ExtraLarge)">
Extra large
</CleanButton>
Loading
When the @onclick parameter of a button returns a task, the button will automatically show its loading state while awaiting the returned task.
However, you can also manually add the Loading parameter to control the button's loading state.
Keep in mind that this requires the Interactive rendering mode.
<CleanButton @onclick="@(Loading.OnClickAsync)">
Click me!
</CleanButton>
<CleanButton Loading>
Loading…
</CleanButton>
Icon-only
<CleanButton IconOnly>
@(Icons.User)
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Primary)" IconOnly>
@(Icons.User)
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Secondary)" IconOnly>
@(Icons.User)
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Danger)" IconOnly>
@(Icons.User)
</CleanButton>
<CleanButton ButtonType="@(CleanButtonType.Link)" IconOnly>
@(Icons.User)
</CleanButton>