Skip to content

Components

The 46 design-system components that come with Astro Orbit: Velocity 2's, in Orbit's colours. Each one is live here, with its code.

01 · 8 components

Form

Get in touch

Button

Button or button-styled link with variants (brand, primary, secondary, outline, ghost, link, destructive), sizes, loading state and optional leading/trailing icons. With unstyled it drops its own look and takes yours from class.

src/components/ui/form/Button/
Show the code
<Button variant="brand" size="lg" trailingIcon="arrow-right" href="/contact">Get in touch</Button>
<Button variant="outline" type="submit" loading>Saving</Button>

We never share it.

Input

Text input with built-in label, hint, error message and optional leading/trailing icons.

src/components/ui/form/Input/
Show the code
<Input name="email" type="email" label="Email" hint="We never share it." leadingIcon="mail" required />

Please enter a message.

Textarea

Multi-line text field with built-in label, hint and error message; grows with its content where supported (autoResize).

src/components/ui/form/Textarea/
Show the code
<Textarea name="message" label="Message" rows={6} error="Please enter a message." />

Select

Native <select> built from an options array, with label, placeholder, hint and error.

src/components/ui/form/Select/
Show the code
<Select
name="plan"
label="Plan"
placeholder="Choose a plan"
options={[
{ value: 'starter', label: 'Starter' },
{ value: 'pro', label: 'Pro' },
]}
/>

Checkbox

Native checkbox with label, optional description and error message. A label with links or emphasis goes in the default slot.

src/components/ui/form/Checkbox/
Show the code
<Checkbox name="updates" label="Send me product updates" description="You can unsubscribe at any time." />
<Checkbox name="terms" required>
I agree to the <a href="/terms" class="underline">terms</a>
</Checkbox>
Billing

Radio

Single native radio input with label and description; give a group the same name. The card variant renders a selectable card, with a media slot for a photo or icon and a default slot for extra content.

src/components/ui/form/Radio/
Show the code
<fieldset class="space-y-3">
<legend class="text-sm font-medium">Billing</legend>
<Radio name="billing" value="monthly" label="Monthly" checked />
<Radio name="billing" value="yearly" label="Yearly" description="Two months free" variant="card">
<Icon slot="media" name="calendar" />
</Radio>
</fieldset>

One email a month.

Switch

Accessible on/off toggle (a checkbox with role="switch") with label and description. Other attributes go to the input, so a switch without a visible label can take aria-label.

src/components/ui/form/Switch/
Show the code
<Switch name="updates" label="Product updates" description="One email a month." checked />
Billing period

ToggleGroup

A segmented control (one choice from a few, e.g. Monthly / Yearly) built from native radio inputs: works without JavaScript and submits with a form. An option can be disabled or carry its own attributes; inputAttrs go to every input.

src/components/ui/form/ToggleGroup/
Show the code
<ToggleGroup
name="billing"
label="Billing period"
value="monthly"
options={[{ value: 'monthly', label: 'Monthly' }, { value: 'yearly', label: 'Yearly' }]}
/>

02 · 10 components

Data display

Card

Surface container with variants and padding; becomes a block link when given href.

src/components/ui/data-display/Card/
Show the code
<Card variant="elevated" padding="lg" hover href="/blog">
<h3 class="font-semibold text-foreground">Read the blog</h3>
<p class="text-foreground-muted text-sm">Guides and release notes.</p>
</Card>
New releaseLiveDraft

Badge

Small inline label for status, tags or counts, with semantic color variants, a pill style and a pulsing dot.

src/components/ui/data-display/Badge/
Show the code
<Badge variant="success" size="sm">Live</Badge>
<Badge variant="brand" pill pulse>New release</Badge>
Ada Lovelace
User avatar

Avatar

Circular user image that falls back to initials (from fallback or alt) when there is no src.

On this page the avatars show initials: the example's pictures aren't part of the theme.

src/components/ui/data-display/Avatar/
Show the code
<Avatar src="/avatars/ada.jpg" alt="Ada Lovelace" size="lg" />
<Avatar fallback="GH" size="sm" />
Ada Lovelace
Grace Hopper
User avatar
+1

AvatarGroup

Overlapping stack of Avatars that collapses extras into a "+N" count.

src/components/ui/data-display/AvatarGroup/
Show the code
<AvatarGroup
max={3}
avatars={[
{ src: '/avatars/ada.jpg', alt: 'Ada Lovelace' },
{ alt: 'Grace Hopper' },
{ fallback: 'AT' },
{ alt: 'Alan Kay' },
]}
/>
What each plan includes
FeatureStarterPro
Projects3Unlimited
Priority supportNot includedIncluded

Table

Responsive data table rendered from columns and rows arrays, with hover, striped and compact options, a caption for screen readers, row headers and icon cells.

src/components/ui/data-display/Table/
Show the code
<Table
caption="What each plan includes"
columns={[
{ key: 'feature', label: 'Feature', rowHeader: true },
{ key: 'starter', label: 'Starter', align: 'center' },
{ key: 'pro', label: 'Pro', align: 'center' },
]}
rows={[
{ feature: 'Projects', starter: '3', pro: 'Unlimited' },
{ feature: 'Priority support', starter: { text: '–', label: 'Not included' }, pro: { icon: 'check', label: 'Included' } },
]}
/>

Pagination

Page navigation (<nav>) with previous/next links and a window of numbered pages built from baseUrl.

src/components/ui/data-display/Pagination/
Show the code
<Pagination currentPage={2} totalPages={8} baseUrl="/blog/page/" />
64%

Progress

Progress bar with semantic color variants and optional percentage label; omit value for an indeterminate bar.

src/components/ui/data-display/Progress/
Show the code
<Progress value={64} variant="brand" showLabel aria-label="Upload progress" />

Skeleton

Animated placeholder block, circle or text line for content that is still loading.

src/components/ui/data-display/Skeleton/
Show the code
<div class="flex items-center gap-3">
<Skeleton variant="circular" width="40px" height="40px" />
<Skeleton variant="text" width="60%" />
</div>

Google Maps

Add PUBLIC_GOOGLE_MAPS_API_KEY to your .env file to enable the map.

GoogleMap

Consent-aware Google Maps embed by coordinates or address; shows a setup prompt without PUBLIC_GOOGLE_MAPS_API_KEY and a placeholder until consent.

The demo has no Google Maps API key, so the map shows what it shows without one. With PUBLIC_GOOGLE_MAPS_API_KEY set, it shows the map.

src/components/ui/data-display/GoogleMap/
Show the code
<GoogleMap address="1 Infinite Loop, Cupertino, CA" zoom={14} size="lg" ariaLabel="Map of our office" />

03 · 4 components

Feedback

Alert

Inline message box (info, success, warning, error) with an icon, optional title and dismiss button.

src/components/ui/feedback/Alert/
Show the code
<Alert variant="warning" title="Scheduled maintenance" dismissible>
The dashboard is read-only on Sunday from 02:00 to 04:00 UTC.
</Alert>

Toast

React toast notifications: ToastProvider renders the stack and useToast() returns toast()/dismiss(). Toast.astro mounts the provider as an island around its slot.

src/components/ui/feedback/Toast/
Show the code
<SaveButton client:load />
Copy to clipboard

Tooltip

Text tooltip shown on hover and focus around a trigger passed in the default slot.

src/components/ui/feedback/Tooltip/
Show the code
<Tooltip content="Copy to clipboard" position="bottom">
<Button variant="ghost" size="sm" icon leadingIcon="copy" aria-label="Copy" />
</Tooltip>
Loading resultsLoading results

Spinner

A loading spinner that inherits the text colour, with a screen-reader label; stops with reduced motion.

src/components/ui/feedback/Spinner/
Show the code
<Spinner size="sm" label="Loading results" />

04 · 7 components

Overlay

Delete project?

This can't be undone.

All deployments will be removed.

Dialog

Modal on the native <dialog> (showModal): focus containment, Escape, backdrop click and focus return come from the browser. Title, description and a footer slot. Open it with data-dialog-open="id" or window.openDialog(id).

src/components/ui/overlay/Dialog/
Show the code
<Button variant="destructive" data-dialog-open="delete-dialog">Delete project</Button>
<Dialog id="delete-dialog" title="Delete project?" description="This can't be undone." size="sm">
<p class="text-sm text-foreground-muted">All deployments will be removed.</p>
<div slot="footer" class="flex justify-end gap-3 px-6 pb-6">
<Button variant="outline" data-dialog-close>Cancel</Button>
<Button variant="destructive" data-dialog-close>Delete</Button>
</div>
</Dialog>

Filters

Filter controls go here.

Sheet

A panel that slides in and out from the left, right or bottom (filters, cart, menu), on the native <dialog>: focus stays inside, Escape or a backdrop click closes it. Opened by any button with data-sheet-open.

src/components/ui/overlay/Sheet/
Show the code
<Button data-sheet-open="filters">Filters</Button>
<Sheet id="filters" title="Filters" side="right">
<p>Filter controls go here.</p>
<Button slot="footer" data-sheet-close fullWidth>Show results</Button>
</Sheet>

Popover

A small panel anchored to its button (details, a few actions), on the native popover attribute: Escape and outside clicks close it with no script; CSS anchor positioning keeps it beside the button.

src/components/ui/overlay/Popover/
Show the code
<Popover label="Plan details">
<Fragment slot="trigger">Details</Fragment>
<p>Billed yearly. Cancel any time.</p>
</Popover>
The first tab's content.
The second tab's content.

Tabs

Horizontal tabs with keyboard navigation; panels are children marked data-tab-content="<tab id>".

src/components/ui/overlay/Tabs/
Show the code
<Tabs tabs={[{ id: 'overview', label: 'Overview' }, { id: 'pricing', label: 'Pricing' }]}>
<div data-tab-content="overview">Overview content</div>
<div data-tab-content="pricing">Pricing content</div>
</Tabs>
Account settings
Security settings

VerticalTabs

Side-list tabs with optional descriptions and icons that turn into a dropdown or bottom sheet on mobile; panels use data-tab-content.

src/components/ui/overlay/VerticalTabs/
Show the code
<VerticalTabs
mobileVariant="sheet"
tabs={[
{ id: 'account', label: 'Account', description: 'Profile and email', icon: 'settings' },
{ id: 'security', label: 'Security', description: 'Password and 2FA', icon: 'shield' },
]}
>
<div data-tab-content="account">Account settings</div>
<div data-tab-content="security">Security settings</div>
</VerticalTabs>
Is it free?
Yes, Astro Orbit is MIT-licensed.
Can I use React?
Yes, as islands.

Accordion

Collapsible sections built on native <details>/<summary> (works without JS), with an exclusive single-open mode.

src/components/ui/overlay/Accordion/
Show the code
<Accordion
variant="card"
exclusive
items={[
{ title: 'Is it free?', content: 'Yes, Velocity is MIT licensed.', defaultOpen: true },
{ title: 'Can I use React?', content: 'Yes, as islands.' },
]}
/>

05 · 4 components

Content and layout

astro.config.mjs
1 export default defineConfig({
2 site: 'https://example.com',
3 });

CodeBlock

Static code display with a window header, optional filename, line numbers and a copy button.

src/components/ui/content/CodeBlock/
Show the code
<CodeBlock filename="astro.config.mjs" code={`export default defineConfig({\n site: 'https://example.com',\n});`} />

Press ⌘K to search, or Esc to close.

Kbd

A keyboard key, or a combination such as ⌘ K from a keys array.

src/components/ui/content/Kbd/
Show the code
Press <Kbd keys={['⌘', 'K']} /> to search, or <Kbd>Esc</Kbd> to close.
Docs Blog

Separator

Horizontal or vertical divider line, optionally with a centered label.

src/components/ui/layout/Separator/
Show the code
<Separator label="or" />
<div class="flex h-6 items-center gap-3">Docs <Separator orientation="vertical" /> Blog</div>

Icon

Inline SVG icon: any Lucide icon by its kebab-case name (lucide.dev/icons), drawn at build time, plus a few brand marks, sized by preset.

src/components/ui/primitives/Icon/
Show the code
<Icon name="calendar-check" size="sm" class="text-primary" />

06 · 6 components

Marketing

Ready to launch?

Start from a site that is fast, accessible and translated.

CTA

Closing call-to-action band centered, with logo, heading, description and actions slots (each rendered only when filled).

src/components/ui/marketing/CTA/
Show the code
<CTA variant="invert" size="md">
<h2 slot="heading">Ready to launch?</h2>
<p slot="description">Start from a site that is fast, accessible and translated.</p>
<Button slot="actions" size="lg" href="/contact">Talk to us</Button>
</CTA>

NpmCopyButton

Button that shows a shell command and copies it to the clipboard, with "copied" feedback.

src/components/ui/marketing/NpmCopyButton/
Show the code
<NpmCopyButton command="npm create velocity-astro@latest" size="md" />

Used by people who build with Astro

SocialProof

Row of overlapping avatar circles (images or placeholders) next to a short trust line.

src/components/ui/marketing/SocialProof/
Show the code
<SocialProof text="Trusted by 2,000+ teams" avatarCount={4} size="md" />
terminal

TerminalDemo

React island that animates a terminal replaying the create-velocity-astro CLI prompts. Takes no props.

The animation is Velocity's own: it types the commands that start a Velocity project.

src/components/ui/marketing/TerminalDemo/
Show the code
<TerminalDemo client:visible />

VideoEmbed

A YouTube or Vimeo video that loads only on play: until then a poster and no third-party request or cookies (youtube-nocookie, Vimeo dnt).

Nothing loads from YouTube until you press play.

src/components/ui/marketing/VideoEmbed/
Show the code
<VideoEmbed provider="youtube" videoId="dQw4w9WgXcQ" title="Product tour" />

Astro Orbit is a free Astro theme.

Read the blog

AnnouncementBar

A strip above the header for a launch or notice: message, optional link and close button; a dismissed bar stays closed per id.

src/components/ui/marketing/AnnouncementBar/
Show the code
<AnnouncementBar id="launch-2-6" href="/blog/velocity-2-6" linkLabel="Read the post" tone="brand">
Velocity 2.6 is out.
</AnnouncementBar>

07 · 7 components

Patterns

Pick any colour.

FormField

Label, hint, error and required marker around a custom control passed in the input slot.

src/components/patterns/
Show the code
<FormField label="Favorite color" hint="Pick any color." required>
<input slot="input" type="color" name="color" class="h-10 w-16 rounded-md border border-border" />
</FormField>

SearchInput

Search field (type="search") built from Input with a leading search icon; used by the Pagefind search page.

src/components/patterns/
Show the code
<form action="/search" role="search">
<SearchInput name="q" placeholder="Search the docs" aria-label="Search" />
</form>

At least 12 characters.

PasswordInput

Password field built from Input with a show/hide toggle button.

src/components/patterns/
Show the code
<PasswordInput name="password" label="Password" autocomplete="new-password" hint="At least 12 characters." />

Monthly visitors

48.2k

+12% from last month

StatCard

Metric card with label, value, optional icon and an up/down/neutral trend line.

src/components/patterns/
Show the code
<StatCard label="Monthly visitors" value="48.2k" trend="up" trendText="+12% from last month" icon="users" />

No results

Try a different search term.

Clear search

EmptyState

Centered placeholder for empty lists or results: icon, title, description and an optional action button or slot.

src/components/patterns/
Show the code
<EmptyState icon="search" title="No results" description="Try a different search term." actionLabel="Clear search" actionHref="/search" />

MediaSlot

Optimized image from src/assets/photos/<photo> at a fixed aspect ratio, or a labelled placeholder until the photo exists.

Without a photo in src/assets/photos/, the slot holds its place with a placeholder, as here.

src/components/patterns/
Show the code
<MediaSlot photo="team" alt="Our team outside the office" label="Team photo" ratio="4/3" />