Sequence
docs
Astro components

Button

Displays a button or a link that looks like a button.

A flexible button component that can render as a <button> or <a> element. It wraps the UI button and adds additional functionality like icons and external link handling.

Usage

---
import Button from '@/components/Button.astro';
---

<Button>Click me</Button>
<Button href="/about">About Us</Button>
<Button variant="outline" size="sm">Small Outline</Button>

Props

PropTypeDefaultDescription
variantstring'default'Visual style of the button (e.g., 'default', 'secondary', 'outline', 'ghost', 'link', 'destructive').
sizestring'default'Size of the button (e.g., 'default', 'sm', 'lg', 'icon').
hrefstring-If provided, renders as an anchor tag (<a>).
as'button' | 'a'-Explicitly set the element type. derived from href if not set.
withArrowbooleanfalseIf true, displays an arrow icon.
externalbooleanfalseIf true, opens link in a new tab (adds target="_blank" and rel="noopener noreferrer").
iconClassstring-Classes to style the arrow icon.
classstring-Additional CSS classes.

Examples

With Arrow

<Button withArrow>
  Get Started
</Button>
<Button href="https://example.com" external>
  External Link
</Button>

On this page