- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Astro
Install Shark UI in an Astro project.
Use the Shark Preset#
Create Project#
Run the init command with the Shark preset and the Astro template:
pnpm dlx shadcn@latest init @shark/style -t astro
Add Components#
You can add components with the CLI or copy them manually from the component docs:
- CLI: Run
npx shadcn@latest add @shark/<component>(e.g.button,dialog). - Manual: Copy component source from Manual tab in the component docs.
For example, add the Button component to your project:
pnpm dlx shadcn@latest add @shark/button
You can also install every component at once:
pnpm dlx shadcn@latest add @shark/ui
Then import and use components in an Astro page with a React client directive:
--- import Layout from "@/layouts/main.astro"; import { Button } from "@/components/ui/button"; --- <Layout> <div class="grid h-screen place-items-center content-center"> <Button client:load>Button</Button> </div> </Layout>
Use the CLI#
Create Project#
Run the init command to scaffold a new Astro project and configure Shark UI:
pnpm dlx shadcn@latest init @shark/style -t astro
For a monorepo project, use the --monorepo flag:
pnpm dlx shadcn@latest init @shark/style -t astro --monorepo
Add Components#
You can add components with the CLI or copy them manually from the component docs:
- CLI: Run
npx shadcn@latest add @shark/<component>(e.g.button,dialog). - Manual: Copy component source from Manual tab in the component docs.
For example, add the Button component to your project:
pnpm dlx shadcn@latest add @shark/button
If you created a monorepo, run the command from apps/web or specify the workspace from the repo root:
pnpm dlx shadcn@latest add @shark/button -c apps/web
You can also install every component at once:
pnpm dlx shadcn@latest add @shark/ui
Then import and use components in an Astro page with a React client directive:
--- import Layout from "@/layouts/main.astro"; import { Button } from "@/components/ui/button"; --- <Layout> <div class="grid h-screen place-items-center content-center"> <Button client:load>Button</Button> </div> </Layout>
If you created a monorepo, update apps/web/src/pages/index.astro and import from your workspace UI package instead. The monorepo layout at apps/web/src/layouts/main.astro already imports your shared global CSS for you.
Existing Project#
Create Project#
If you need a new Astro project, create one first. Otherwise, skip this step.
pnpm create astro@latest astro-app -- --template with-tailwindcss --install --add react --git
This command sets up Tailwind CSS and the React integration for you. If you're adding Shark UI to an older or custom Astro app, make sure both are configured before continuing.
The Tailwind starter loads your global stylesheet through src/layouts/main.astro. Keep that layout in place, or make sure your page imports @/styles/global.css.
Edit tsconfig.json#
Add path aliases so imports resolve correctly:
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } } }
Run the CLI#
Run the shadcn init command with the Shark preset to set up your project.
pnpm dlx shadcn@latest init @shark/style
Add Components#
You can add components with the CLI or copy them manually from the component docs:
- CLI: Run
npx shadcn@latest add @shark/<component>(e.g.button,dialog). - Manual: Copy component source from Manual tab in the component docs.
For example, add the Button component to your project:
pnpm dlx shadcn@latest add @shark/button
You can also install every component at once:
pnpm dlx shadcn@latest add @shark/ui
Then import and use components in an Astro page with a React client directive:
--- import Layout from "@/layouts/main.astro"; import { Button } from "@/components/ui/button"; --- <Layout> <div class="grid h-screen place-items-center content-center"> <Button client:load>Button</Button> </div> </Layout>