Documentation
Description
A configurable button with size and variant modifiers.
Demonstrates:
- StrParam with positional args
- StrCSSClassParam — value injected as a CSS modifier class
- BoolCSSClassParam — adds a CSS class when truthy
- Co-located CSS file (button.css) discovered automatically
- Co-located HTML template (button.html) discovered automatically
Example usage::
{% button "Save changes" %}
{% button "Delete" variant="danger" disabled=True %}
Usage
Qualified tag usage
{% btn__button "foo" %}
Parameters
| Name | Type | Required | Default | Choices | Description |
|---|---|---|---|---|---|
label
|
str
|
Yes | — | — | The button label. |
variant
|
str
|
No |
primary
|
primary
,
secondary
,
danger
|
Visual variant. |
disabled
|
bool
|
No | — | — | Renders the button as disabled. |
Sandbox