DocumentationInstallation

Open in Create
Search
astronomic.dev

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.

sh
pnpm add @astronomic-dev/ui astro tailwindcss @tailwindcss/vite

It installs as @astronomic-dev/ui. Add Tailwind's Vite plugin in astro.config.mjs:

js
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:

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

ThemeFree partsPro parts
Free themeThe whole free kitNone
Paid theme that uses ProThe whole free kitOnly the Pro parts that theme imports, and the files they need
Paid theme without ProThe whole free kitNone

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:

PathWhat 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.cssThe theme's main CSS file, which loads the kit
AGENTS.mdNotes 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:

css
@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:

css
@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:

astro
---
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:

PartsNeeds
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

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.