ActionsButton

Open in Create
Search
astronomic.dev

Button

Free

For the main action on a page or in a form, and for links that should look like one.

File
Button.astro
Group
Actions
Kind
Static: no JavaScript
Examples
9
import Button from "@astronomic-dev/ui/components/Button.astro";

Examples

Drag the orange handle to set the width. Frames get real breakpoints.

  • Static
  • Interactive
  • Framed

Variants

Force state
main.astro

Sizes

sm, md and lg. Use one size per row of buttons.

Force state
sizes.astro

With href, a Button renders a link. A disabled link drops its `href`.

Icon tile

iconTile={ArrowRight} puts your icon in a round tile at the end of a fully round pill, in the button's own colors inverted. The icon turns on hover and focus when motion is allowed.

Force state
icon-tile.astro

Sliding arrow

tileMotion="slide": on hover and keyboard focus the icon slides out of its tile and a copy slides in from the other side. Still under reduced motion or the theme's calm setting.

Force state
tile-slide.astro

Square corners

--ui-radius-pill sets the pill's corners (fully round by default). The tile's corners follow: the pill's radius less the tile's 6px inset, so they run parallel. Here 10px gives the tile 4px.

Force state
tile-square.astro

Rolling label

roll rolls the label up on hover and keyboard focus, and the same words roll in from below. It stays still under reduced motion or the theme's calm setting. For a nav link, see "Rolling links" in the kit README.

Force state
roll.astro

On the dark panel

tone="inverse" with iconTile and roll on Panel tone="inverse": the tile inverts with the button.

on-inverse.astro

On the accent

tone="accent" on the accent surface (surface-accent, as GuaranteeStrip and EmergencyBanner): the primary is an accent-fg fill with accent text, the secondary an accent-fg outline. Put focus-on-accent on the surface for the focus ring.

tone-accent.astro
Minimal · Light

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.