Installation
Set up Eris UI in an Astro 5.2+ project.
1. Run init
In the root of your Astro project:
npx eris-ui@latest initpnpm dlx eris-ui@latest initbunx eris-ui@latest inityarn dlx eris-ui@latest initinit does four things:
- Runs
astro add tailwindif Tailwind CSS v4 is not set up yet. - Imports
eris-theme.cssright after@import "tailwindcss"insrc/styles/global.css. - Adds the
@/*path alias totsconfig.json, which the components import from. - Writes
eris.jsonand copieseris-coreintosrc/lib/eris.
2. Import the stylesheet
Make sure a layout imports your global CSS, and load the Geist font if you want the default look:
src/layouts/Layout.astro
---
import "../styles/global.css";
---
<html lang="en">
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&display=swap" rel="stylesheet" />
</head>
<body class="bg-background text-foreground">
<slot />
</body>
</html>3. Add components
npx eris-ui@latest add dialogpnpm dlx eris-ui@latest add dialogbunx eris-ui@latest add dialogyarn dlx eris-ui@latest add dialogInstalls @zag-js/dialog, @zag-js/vanilla. Also adds button.
Components land in src/components/ui. Import them like any other Astro component:
---
import Dialog from "@/components/ui/dialog/Dialog.astro";
import DialogTrigger from "@/components/ui/dialog/DialogTrigger.astro";
---Updating
Copied code does not update itself. To see what changed upstream since you added a component:
npx eris-ui@latest diff dialogRun add again with --overwrite to take the new version. Without it, add keeps any file you have changed.