Installation
How you install the free kit from GitHub, and where the kit lives in a theme.
There are two ways to get Astronomic UI. The free kit is an npm package that any Astro site can install. It also comes with every Astronomic theme, so a theme needs nothing extra.
Install the free kit
The kit needs Astro 7 and Tailwind CSS 4.3 or later. Install it from npm, with its peers. The source is on GitHub at astronomic-dev/astronomic-ui.
pnpm add @astronomic-dev/ui astro tailwindcss @tailwindcss/viteIt installs as @astronomic-dev/ui. Add Tailwind's Vite plugin in astro.config.mjs:
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "astro/config";
export default defineConfig({
vite: { plugins: [tailwindcss()] },
});Then load the kit in the site's main CSS file, for example src/styles/global.css:
@import "tailwindcss";
@import "@astronomic-dev/ui/tokens.css";
@import "@astronomic-dev/ui/theme.css";
@import "@astronomic-dev/ui/presets/soft.css"; /* optional: a preset, after tokens.css */
/* Tailwind skips node_modules, so point it at the kit's source.
The path is relative to this CSS file. */
@source "../../node_modules/@astronomic-dev/ui/src";Without a preset you get the default look. See Presets for the others and the fonts each one uses. The free kit is source, not a build: the components are .astro files you can read in node_modules/@astronomic-dev/ui/src.
The kit is free and MIT licensed. Pro parts are not in it: they come only inside the paid themes that use them. See Free and Pro.
What comes with which theme
| Theme | Free parts | Pro parts |
|---|---|---|
| Free theme | The whole free kit | None |
| Paid theme that uses Pro | The whole free kit | Only the Pro parts that theme imports, and the files they need |
| Paid theme without Pro | The whole free kit | None |
Being paid does not make a theme include Pro. Only some paid themes use Pro parts, and none include all of Pro. A theme that does has a Pro folder with the parts its pages import, and that folder's README.md lists them. See Free and Pro.
Where the kit lives in a theme
The kit is a package inside the theme's repo, next to the theme's own files:
| Path | What it holds |
|---|---|
packages/ui | @astronomic-dev/ui: the free components, sections, tokens and presets |
packages/ui-pro | @astronomic/ui-pro: the theme's Pro parts (paid themes that use Pro) |
src/styles/global.css | The theme's main CSS file, which loads the kit |
AGENTS.md | Notes for a coding agent, including the rules for using the kit |
The packages are part of your repo, so you can read and change them. Prefer changes in the theme's own files, so the kit stays easy to compare with this directory.
How a theme loads the kit
A theme's src/styles/global.css loads the kit the same way, with Tailwind, then the kit's tokens and theme:
@import "tailwindcss";
@import "@astronomic-dev/ui/tokens.css";
@import "@astronomic-dev/ui/theme.css";
/* Tailwind skips node_modules, so point it at the kit's source. */
@source "../../node_modules/@astronomic-dev/ui/src";A theme that uses Pro adds one more line:
@source "../../node_modules/@astronomic/ui-pro/src";Warning
Keep the @source lines. Without them, Tailwind does not see the kit's classes and the parts render unstyled.
Use a part
Import a part by its path, then use it in a page:
---
import Button from "@astronomic-dev/ui/components/Button.astro";
---
<Button href="/contact">Get in touch</Button>Each part's page in this directory shows its import line, examples and props. Pro parts import from @astronomic/ui-pro/components/ in the same way.
What a site needs
The kit needs Astro 7 and Tailwind CSS 4.3 or later (tailwindcss ^4.3.0, with @tailwindcss/vite). Every theme already has both, and the install line above adds them to any other site. The free kit needs no React.
A few parts need one more package, which a theme that uses them already has:
| Parts | Needs |
|---|---|
Site search (SearchClassic, SearchButton, SearchPage) | @astronomic-dev/search |
Pro Tabs (a React island) | @astrojs/react, react, react-dom and @base-ui/react |
Pro maps (MapView, MapSplit) | maplibre-gl |