Astro UI
shadcn/ui
Astro + Shadcn/UI

Beautiful components, zero JS overhead.

Pure Astro components using shadcn/ui's design system. No React, no hydration for static components. Pick a theme, download the CSS, and ship.

$ npx @emhamitay/astro-ui init
$ npx @emhamitay/astro-ui add --all
16 Astro components
28 React component links
6 built-in themes
CLI installer via npx
⚡ AI Component Selection Guide

This library covers the zero-JS use case. Pick the right version based on whether the component needs JavaScript:

❌ No JS needed → Astro component

Button (link/submit), Card, Badge, Avatar, Input, Textarea, Label, Table, Breadcrumb, Progress, Skeleton, Separator, Accordion, Checkbox, Select

✅ Needs JS → React shadcn/ui

Dialog, Sheet, Drawer, DropdownMenu, Popover, Tooltip, Tabs, Switch, Slider, Toast, Sonner — anything with click handlers or state

The same component type (e.g. Button) may use either version depending on what it needs to do.

Theme Switcher & CSS Download

Optional: Geist Sans — same font as shadcn.com, not required.

CLI Usage
$ npx @emhamitay/astro-ui init # fetch globals.css + utils.ts
$ npx @emhamitay/astro-ui add button # add a single component
$ npx @emhamitay/astro-ui add card badge separator # add multiple
$ npx @emhamitay/astro-ui add --all # add everything
$ npx @emhamitay/astro-ui list # see all available components
Using with AI Tools (v0, Cursor, Copilot, etc.)

When using AI tools like v0, Cursor, Copilot, or Claude to generate components, give the AI the component reference as context so it generates correct Astro-native code instead of React. Copy the reference below, or paste the raw file URL directly into tools that accept a URL as context.

Raw file link

paste this URL into tools that accept a link as context (points to llms.txt)

Astro Components

Accordion

Astro

Zero-JS accordion using native details/summary elements. The chevron animates via CSS only.

Is it accessible?
Yes. It uses native <details>/<summary> HTML elements which are accessible by default.
Is it styled?
Yes. It comes with default styles that match the shadcn/ui design system.
Is it animated?
Yes. The chevron rotates via CSS transition — no JavaScript required.
View code
import Accordion from '@/components/astro/Accordion.astro';

<Accordion items={[
  { title: 'Is it accessible?', content: 'Yes. It uses native <details>/<summary> HTML.' },
  { title: 'Is it styled?', content: 'Yes. It comes with default styles.' },
  { title: 'Is it animated?', content: 'Yes. The chevron rotates via CSS.' },
]} />

Button

Astro

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

View code
import Button from '@/components/astro/Button.astro';

<Button>Click me</Button>
<Button variant="outline">Outline</Button>
<Button variant="destructive">Delete</Button>

Badge

Astro

Displays a badge or a component that looks like a badge.

Default
Secondary
Destructive
Outline
View code
import Badge from '@/components/astro/Badge.astro';

<Badge>Default</Badge>
<Badge variant="secondary">Secondary</Badge>
<Badge variant="destructive">Destructive</Badge>
<Badge variant="outline">Outline</Badge>

Card

Astro

Displays a card with header, content, and footer.

Notification

You have 3 unread messages.

Your trial ends in 3 days. Upgrade to keep your data.

View code
import Card from '@/components/astro/Card.astro';
import CardHeader from '@/components/astro/CardHeader.astro';
import CardTitle from '@/components/astro/CardTitle.astro';
import CardDescription from '@/components/astro/CardDescription.astro';
import CardContent from '@/components/astro/CardContent.astro';
import CardFooter from '@/components/astro/CardFooter.astro';

<Card>
  <CardHeader>
    <CardTitle>Title</CardTitle>
    <CardDescription>Description</CardDescription>
  </CardHeader>
  <CardContent>Content</CardContent>
  <CardFooter>Footer</CardFooter>
</Card>

Alert

Astro

Displays a callout for user attention.

View code
import Alert from '@/components/astro/Alert.astro';
import AlertTitle from '@/components/astro/AlertTitle.astro';
import AlertDescription from '@/components/astro/AlertDescription.astro';

<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>You can add components.</AlertDescription>
</Alert>

Avatar

Astro

An image element with a fallback for representing the user.

User User 2 MK TZ PQ
View code
import Avatar from '@/components/astro/Avatar.astro';

<Avatar src="/photo.jpg" alt="Jane Doe" fallback="JD" />
<Avatar fallback="AB" />
<Avatar fallback="TZ" size="lg" />

Separator

Astro

Visually or semantically separates content.

Radix Primitives

An open-source UI component library.

Blog Docs Source
View code
import Separator from '@/components/astro/Separator.astro';

<Separator />
<Separator orientation="vertical" class="h-6" />

Skeleton

Astro

Use to show a placeholder while content is loading.

View code
import Skeleton from '@/components/astro/Skeleton.astro';

<Skeleton class="h-4 w-48" />
<Skeleton class="h-12 w-12 rounded-full" />

Progress

Astro

Displays an indicator showing the completion progress of a task.

View code
import Progress from '@/components/astro/Progress.astro';

<Progress value={60} />
<Progress value={25} class="h-2" />

Input

Astro

Displays a form input field.

View code
import Input from '@/components/astro/Input.astro';

<Input type="text" placeholder="Email address" />
<Input type="password" placeholder="Password" />

Textarea

Astro

Displays a form textarea.

View code
import Textarea from '@/components/astro/Textarea.astro';

<Textarea placeholder="Tell us about yourself..." />

Label

Astro

Renders an accessible label associated with controls.

View code
import Label from '@/components/astro/Label.astro';
import Input from '@/components/astro/Input.astro';

<Label for="email">Email</Label>
<Input id="email" type="email" placeholder="you@example.com" />

Table

Astro

A responsive table component.

Invoice Status Method Amount
INV-001PaidCredit Card$250.00
INV-002PendingPayPal$150.00
INV-003UnpaidBank Transfer$350.00
View code
import Table from '@/components/astro/Table.astro';

<Table
  columns={[
    { key: 'invoice', header: 'Invoice' },
    { key: 'status', header: 'Status' },
    { key: 'amount', header: 'Amount' },
  ]}
  rows={[
    { invoice: 'INV-001', status: 'Paid', amount: '$250.00' },
  ]}
/>

Checkbox

Astro

A control that allows the user to toggle between checked and not checked.

View code
import Checkbox from '@/components/astro/Checkbox.astro';
import Label from '@/components/astro/Label.astro';

<div class="flex items-center gap-2">
  <Checkbox id="terms" name="terms" />
  <Label for="terms">Accept terms and conditions</Label>
</div>

Select

Astro

Styled native select element. The dropdown panel is OS-styled — for a fully custom dropdown, use the React shadcn/ui version.

View code
import Select from '@/components/astro/Select.astro';
import Label from '@/components/astro/Label.astro';

<Label for="framework">Framework</Label>
<Select
  id="framework"
  name="framework"
  placeholder="Select a framework…"
  options={[
    { value: 'astro', label: 'Astro' },
    { value: 'next', label: 'Next.js' },
    { value: 'remix', label: 'Remix' },
  ]}
/>

React Required

Use via shadcn/ui React components

Alert Dialog

React
shadcn/ui

Requires JavaScript & React for interactivity

View Alert Dialog on shadcn/ui

Calendar

React
shadcn/ui

Requires JavaScript & React for interactivity

View Calendar on shadcn/ui

Checkbox

React
shadcn/ui

Requires JavaScript & React for interactivity

View Checkbox on shadcn/ui

Collapsible

React
shadcn/ui

Requires JavaScript & React for interactivity

View Collapsible on shadcn/ui

Command

React
shadcn/ui

Requires JavaScript & React for interactivity

View Command on shadcn/ui

Context Menu

React
shadcn/ui

Requires JavaScript & React for interactivity

View Context Menu on shadcn/ui

Dialog

React
shadcn/ui

Requires JavaScript & React for interactivity

View Dialog on shadcn/ui

Drawer

React
shadcn/ui

Requires JavaScript & React for interactivity

View Drawer on shadcn/ui

Form

React
shadcn/ui

Requires JavaScript & React for interactivity

View Form on shadcn/ui

Hover Card

React
shadcn/ui

Requires JavaScript & React for interactivity

View Hover Card on shadcn/ui

Input OTP

React
shadcn/ui

Requires JavaScript & React for interactivity

View Input OTP on shadcn/ui

Popover

React
shadcn/ui

Requires JavaScript & React for interactivity

View Popover on shadcn/ui

Radio Group

React
shadcn/ui

Requires JavaScript & React for interactivity

View Radio Group on shadcn/ui

Resizable

React
shadcn/ui

Requires JavaScript & React for interactivity

View Resizable on shadcn/ui

Scroll Area

React
shadcn/ui

Requires JavaScript & React for interactivity

View Scroll Area on shadcn/ui

Select

React
shadcn/ui

Requires JavaScript & React for interactivity

View Select on shadcn/ui

Sheet

React
shadcn/ui

Requires JavaScript & React for interactivity

View Sheet on shadcn/ui

Slider

React
shadcn/ui

Requires JavaScript & React for interactivity

View Slider on shadcn/ui

Sonner

React
shadcn/ui

Requires JavaScript & React for interactivity

View Sonner on shadcn/ui

Switch

React
shadcn/ui

Requires JavaScript & React for interactivity

View Switch on shadcn/ui

Tabs

React
shadcn/ui

Requires JavaScript & React for interactivity

View Tabs on shadcn/ui

Toast

React
shadcn/ui

Requires JavaScript & React for interactivity

View Toast on shadcn/ui

Toggle

React
shadcn/ui

Requires JavaScript & React for interactivity

View Toggle on shadcn/ui

Toggle Group

React
shadcn/ui

Requires JavaScript & React for interactivity

View Toggle Group on shadcn/ui

Tooltip

React
shadcn/ui

Requires JavaScript & React for interactivity

View Tooltip on shadcn/ui

Ready to use in your Astro project?

Pick your theme above, download the CSS, drop the component files into your project, and you're done.