Modal Component
Default — small (400px)
Icon + title + body + footer
<Button Variant="primary" Text="Open modal"
OnClick="() => showDefault = true" />
<Modal @bind-IsOpen="showDefault"
Title="Add labels to project"
Description="Labels help organize projects."
Size="sm">
<Icon>
<svg>...tag icon...</svg>
</Icon>
<ChildContent>
<InputField Placeholder="Search for label" />
</ChildContent>
<Footer>
<Button Variant="secondary" Text="Cancel" OnClick="() => showDefault = false" />
<Button Variant="primary" Text="Add labels" OnClick="() => showDefault = false" />
</Footer>
</Modal>
@code { private bool showDefault; }Sizes
Four preset widths
@* Sizes: sm (400), md (480), lg (560), xl (640) *@
<Modal @bind-IsOpen="showMd" Size="md" Title="Medium modal">
<ChildContent>...</ChildContent>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Confirm" />
</Footer>
</Modal>Destructive confirmation
Use primary-destructive for both trigger and confirm
<Button Variant="primary-destructive"
Text="Delete project"
OnClick="() => showDestructive = true" />
<Modal @bind-IsOpen="showDestructive"
Title="Delete project"
Description="This action cannot be undone."
Size="sm">
<Icon>
<svg>...trash icon...</svg>
</Icon>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary-destructive" Text="Delete" />
</Footer>
</Modal>Without icon
Omit the Icon slot for a text-only header
<Modal @bind-IsOpen="showNoIcon"
Title="Edit workspace name"
Description="Rename your workspace to something meaningful."
Size="sm">
<ChildContent>
<InputField Label="Workspace name" Value="Design System" />
</ChildContent>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Save changes" />
</Footer>
</Modal>Footer with status message
Validation error on the left, actions on the right
<Modal @bind-IsOpen="showValidation"
Title="Edit workspace"
Size="md"
StatusType="error"
StatusMessage="Please fix 2 fields before saving">
<ChildContent>
<InputField Label="Workspace name" Value="" />
<InputField Label="Contact email" Value="not-an-email" />
</ChildContent>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Save changes" />
</Footer>
</Modal>Success status — auto-saved indicator
<Modal @bind-IsOpen="showSaved"
Title="Edit workspace"
Size="md"
StatusType="success"
StatusMessage="Last saved a moment ago">
<ChildContent>...</ChildContent>
<Footer>
<Button Variant="secondary" Text="Close" />
<Button Variant="primary" Text="Done" />
</Footer>
</Modal>
@* StatusType options: neutral | info | success | warning | error *@Custom FooterStatus slot — loading spinner
<Modal @bind-IsOpen="showSaving" Title="Edit workspace" Size="md">
<FooterStatus>
@* Custom slot — render anything (spinner, count badge, link) *@
<span class="modal-footer__status-icon">
<svg style="animation: spin 0.8s linear infinite;">...</svg>
</span>
<span class="modal-footer__status-text">Saving changes…</span>
</FooterStatus>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Save" Disabled />
</Footer>
</Modal>Footer actions layout
ActionsLayout="split" — full-width buttons (default when no status)
<Modal @bind-IsOpen="showSplit"
Title="Confirm action"
Size="md"
ActionsLayout="split">
<ChildContent>...</ChildContent>
<Footer>
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Confirm" />
</Footer>
</Modal>
@* ActionsLayout values: auto (default) | split | end *@ActionsLayout="end" — content-sized, right-aligned
<Modal @bind-IsOpen="showEnd"
Title="Review changes"
Size="md"
ActionsLayout="end">
<ChildContent>...</ChildContent>
<Footer>
<Button Variant="tertiary" Text="Save draft" />
<Button Variant="secondary" Text="Cancel" />
<Button Variant="primary" Text="Publish" />
</Footer>
</Modal>
@* Use "end" when you have 3+ buttons, or when stretched
labels look awkward. Buttons keep their natural width. *@Add labels to project
Labels help organize projects.
Modal — sm
This is a sm size modal dialog.
This demonstrates the sm modal size.
Modal — md
This is a md size modal dialog.
This demonstrates the md modal size.
Modal — lg
This is a lg size modal dialog.
This demonstrates the lg modal size.
Modal — xl
This is a xl size modal dialog.
This demonstrates the xl modal size.
Delete project
Are you sure you want to delete this project? This action cannot be undone.
Edit workspace
Update your workspace details.
Edit workspace
Changes save automatically.
Edit workspace
Saving your changes…
Confirm action
Pick one of the options below.
Both buttons span the row equally — the classic two-column footer.
Review changes
Buttons hug their text and sit on the right.
Use this when the modal has a third action (e.g. Save draft) or when the labels read awkwardly stretched across the row.
Edit workspace name
Rename your workspace to something meaningful.