Button

A native button with an explicit type and variant, and a link that reads as a button.

Primary, secondary, ghost and danger; the server counts every click.

Open in new tab

Each preview is its own Live page in a frame, because this site is a Vue 3.5 app built on the Pulsar starter kit. An open list or popover stays inside its frame; in your application it opens over the page.

Installation

bash
suprnova live:add button

Usage

html
{% import "suprnova-ui/button/button.html" as button %}
{% call button::button("Save", kind="submit", action="save") %}{% endcall %}

Examples

Link button

An anchor for navigation that is a real request; these open in this window.

Open in new tab

Keyboard and accessibility

suprnova.button - a native button with an explicit type. action names a Live action for click buttons; a submit button relies on the form's live:submit and shows the action's loading state on itself. link_button is an anchor that reads as a button for navigation that is a real request.

API reference

button

ParameterDefaultDescription
textRequiredThe button text.
kind"button"`button` or `submit`. A submit button relies on the form's `live:submit`.
action""The Live action a click button invokes; its loading state disables the button.
variant"primary"`primary`, `secondary`, `ghost` or `danger`.

link_button

ParameterDefaultDescription
textRequiredThe link text.
hrefRequiredWhere it goes: a real request.
variant"secondary"As for `button`; `secondary` by default.