Actions / Button

Actions

Button

The one primary per region, with secondary, tertiary, danger and on-fill variants.

import { EcoButton } from "vue-ecosphere"

Variants

One filled button per region. A danger button is the destructive primary and counts as that one: its label names the consequence, never “OK”.

Small

For actions inside rows, cards and toolbars.

Disabled

Always pair a disabled control with text that says why.

Loading

While the action runs, the spinner takes the leading icon's place and the label stays, so the button barely moves. It keeps its colour and focus, and ignores clicks.

Through the router

With vue-router installed, `to` renders an anchor with the resolved href and navigates without a page load. Middle-click and modifier-clicks still open a new tab.

Current page

The button for the route you are on carries aria-current="page", and a tertiary one shows it, so a row of them works as a topbar.

On fill

Only on the hero wash: a white button and a glass ghost.

API

NameTypeDefaultDescription
variant"primary" | "secondary" | "tertiary" | "danger" | "onfill" | "ghostfill""secondary"Visual weight. One primary (or danger) per region.
size"md" | "sm""md"Small buttons sit inside rows and cards.
iconstring—Leading RemixIcon name without the ri- prefix.
iconEndstring—Trailing icon, nudged on hover (use an arrow).
labelstring—Text when you don't use the default slot.
widebooleanfalseStretch to the container width.
hrefstring—Render as an anchor.
tostring | RouteLocationRaw—Navigate through vue-router's RouterLink (an anchor with the resolved href) when the app has it installed; a string falls back to a plain link. Disabled or loading renders a button.
type"button" | "submit" | "reset""button"Native button type.
disabledbooleanfalsePair with text that explains why.
loadingbooleanfalseThe action is running: a spinner replaces the leading icon, the label stays, aria-busy is set and clicks (and form submits) are ignored. Keeps the variant colour and focus; an href button renders as a button meanwhile.