# Installation

Create an app from the Zenos starter template, or install Zenos in an existing React app.

Create a new app from the Zenos starter template, or add Zenos to an existing React 19 app using the manual installation steps below.

## Create an app from the starter template

Run the starter executable with Bun or npm:

```sh title="Bun"
bunx @zentara-co/create-zenos-app@latest
```

```sh title="npm"
npx @zentara-co/create-zenos-app@latest
```

For an existing app, follow the installation steps below.

From install to your first button:

Check the requirements, install the tools, then check your React app.

1. **Check your setup.** `React 19 + an ESM bundler`. Install from public npm without a token or repository access.
2. **Install the UI and CLI.** `@zentara-co/zenos-ui + @zentara-co/zenos-cli`. Add the UI to dependencies and the CLI to development dependencies.
3. **Style and check your app.** `@import → index.css → your app`. Import Zenos CSS in index.css, load that file once, then check a button and its keyboard focus.

## Before you begin

Zenos UI and CLI are public npm packages under the `@zentara-co` scope. Installation does not require repository access or a token.
You need React and React DOM `19.x`, plus a framework or bundler that supports ESM and CSS imports. Vite, Next.js, Astro with React, React Router, and TanStack Start are supported setups. TypeScript `5.x` is recommended.

## 1. Install the UI

Install directly from the public npm registry. No login or token is needed.

Run this in the folder containing your app's `package.json`. Choose the package manager your project uses:

```bash
pnpm add @zentara-co/zenos-ui
npm install @zentara-co/zenos-ui
yarn add @zentara-co/zenos-ui
bun add @zentara-co/zenos-ui
```

In a monorepo, install it in the package that renders React. Zenos includes its component dependencies; you do not need to install Base UI separately.

Run the CLI directly with `bunx`, `npx`, `pnpm dlx`, or `yarn dlx`, without installing it in your project (Node.js 20 or newer is required):

```bash
pnpm dlx @zentara-co/zenos-cli --help
npx @zentara-co/zenos-cli --help
yarn dlx @zentara-co/zenos-cli --help
bunx @zentara-co/zenos-cli --help
```

The CLI provides component lookups, AI instructions, and recipe installation. See the [CLI guide](/getting-started/cli/) for commands.

<details>
<summary>Migrating from GitHub Packages?</summary>

If you previously installed Zenos from GitHub Packages, remove its `@zentara-co` registry mapping and token line from your project's and user-level `.npmrc`. If you use a custom default registry, add this scope mapping:

```ini title=".npmrc"
@zentara-co:registry=https://registry.npmjs.org
```

Update existing lockfile entries that still resolve Zenos packages from GitHub Packages.

</details>

## 2. Load the styles

Put Zenos stylesheet imports in your application's global `index.css`. Import that local CSS file once from your framework entry or root layout. Keep package CSS imports out of component and `.tsx` files.

For a Tailwind CSS v4 application, put these imports at the top of `index.css`, before your own rules:

```css title="src/index.css"
@import "tailwindcss";
@import "@zentara-co/zenos-ui/tailwind.css";
```

This CSS entrypoint exposes Zenos theme utilities and custom variants to Tailwind CSS IntelliSense. The compiled `styles.css` entrypoint supplies runtime styles but does not register Zenos' Tailwind design metadata with the editor. Use `tailwind.css` for Tailwind projects, and load it through CSS rather than importing it directly from JavaScript or TypeScript.

Tailwind must already be installed and configured for your framework. No Zenos package source scanning or additional Tailwind configuration is required. If suggestions are missing, follow [Troubleshoot IntelliSense](/getting-started/project-setup/#troubleshoot-intellisense).

<details>
<summary>My app does not use Tailwind CSS</summary>

Use the compiled stylesheet in `index.css` instead:

```css title="src/index.css"
@import "@zentara-co/zenos-ui/styles.css";
```

Add your own CSS rules below the import. This stylesheet includes the component styles, layout helpers, and theme tokens without requiring Tailwind.

</details>

Choose one setup. Do not import `styles.css` together with `tailwind.css`, and remove any separate package CSS import from `.tsx` files. Global CSS also styles menus and dialogs that render outside the component that opened them.

### Connect index.css to your framework

The examples below use `index.css` as the global stylesheet. Keep existing application code and move your shared CSS rules into that file when changing its name.

<details id="vite">
<summary>Vite — src/main.tsx</summary>

Put the CSS imports above in `src/index.css`, then load that file:

```tsx title="src/main.tsx"
import "./index.css";
```

The React app is already interactive. Keep the existing `createRoot` setup below this import.

</details>

<details id="nextjs">
<summary>Next.js — app/layout.tsx</summary>

Put the CSS imports above in `app/index.css`, then load that file:

```tsx title="app/layout.tsx"
import "./index.css";
```

Keep the root layout on the server. Put `"use client"` at the top of a component file when it owns state or event handlers, such as the form in Quick Start. For the Pages Router, load the same global stylesheet from `pages/_app.tsx` using its relative path.

</details>

<details id="astro">
<summary>Astro with React — your shared .astro layout</summary>

Put the CSS imports above in `src/styles/index.css`, then load that file in the layout's frontmatter:

```astro title="src/layouts/AppLayout.astro"
---
import "../styles/index.css";
---
```

Astro renders React components as HTML by default. To make a form or dialog interactive, import it into an Astro page and add `client:load`:

```astro title="src/pages/index.astro"
---
import AppLayout from "../layouts/AppLayout.astro";
import ProjectForm from "../components/ProjectForm";
---

<AppLayout>
  <ProjectForm client:load />
</AppLayout>
```

This assumes your shared layout renders a `<slot />` and the [React integration](https://docs.astro.build/en/guides/integrations-guide/react/) is installed. Keep static content unhydrated; use `client:idle` or `client:visible` for interactions that can wait.

</details>

<details id="react-router">
<summary>React Router Framework Mode — app/root.tsx</summary>

Put the CSS imports above in `app/index.css`, then load that file:

```tsx title="app/root.tsx"
import "./index.css";
```

Keep your existing document, ``, ``, and ``. The root route loads these styles for every page. See the [React Router styling guide](https://reactrouter.com/explanation/styling) for route stylesheet links.

</details>

<details id="tanstack-start">
<summary>TanStack Start — src/routes/__root.tsx</summary>

Put the CSS imports above in `src/index.css`, then load that file:

```tsx title="src/routes/__root.tsx"
import "../index.css";
```

Keep the root document's `` and ``. See the [TanStack Start styling guide](https://tanstack.com/start/latest/docs/framework/react/guide/css-styling) for stylesheet links when your setup requires them.

</details>

## 3. Check your first component

Render this component on a page in your app:

```tsx title="Welcome.tsx"
import { Button } from "@zentara-co/zenos-ui";

export default function Welcome() {
  return <Button variant="primary">Create project</Button>;
}
```

Start your app with its usual development command and open that page. You should see a styled primary button. Press Tab to check its visible focus outline. This button checks the installation; it has no click action yet.

Run your app's type check and production build before continuing to [Quick Start](/getting-started/quick-start/), where you will add a working form.

## Optional finishing touches

<details>
<summary>Match the fonts in the docs</summary>

Zenos uses SUSE, Albert Sans, and Geist Mono font stacks. The package does not download the fonts for you. Load them through your framework or self-host them; system fonts work as fallbacks.

See [Fonts](/foundations/fonts/) for setup and supported weights.

</details>

<details>
<summary>Add dark mode</summary>

Zenos supports `.dark` or `data-theme="dark"` on the document root. Use [ThemeToggleButton](/components/theme-toggle-button/) or [useTheme](/hooks/use-theme/) if Zenos should manage the preference.

For server-rendered apps, apply the saved theme before the page is painted. Use the same storage key everywhere (`theme` by default). If another provider owns the theme, share that key or disable Zenos persistence with `storageKey={null}`. See [Dark mode](/foundations/dark-mode/) for the full example.

Keep browser-only reads such as `localStorage` out of server rendering. The server and client should initially render the same content.

</details>

<details>
<summary>Add recipes or AI instructions</summary>

The CLI can copy recipes into your app and create instructions for your AI assistant. Start with the [CLI guide](/getting-started/cli/) or [Working with AI](/getting-started/working-with-ai/).

Calendar, Carousel, Chart, Data Table, and File Upload bring their extra dependencies only when you install those recipes.

</details>

## If something goes wrong

- **401, 403, or package not found:** check that the `@zentara-co` scope resolves to `https://registry.npmjs.org`, remove any old GitHub Packages mapping, and confirm the requested version exists on npm.
- **The button is unstyled:** check that your entry or root layout loads `index.css` and that its Zenos import appears before your own CSS rules.
- **Tailwind suggestions are missing:** use `@import "tailwindcss"` and `@import "@zentara-co/zenos-ui/tailwind.css"` in `index.css`, then check the [IntelliSense setup](/getting-started/project-setup/#troubleshoot-intellisense).
- **Menus or dialogs are unstyled:** load the stylesheet globally, so it also covers content rendered elsewhere in the document.
- **Astro controls do not respond:** add a client directive to the React component that owns the interaction.
- **A server-rendering or hydration error appears:** check the framework's client boundary and remove browser-only reads from server rendering.

Need application configuration next? Continue to [Project Setup](/getting-started/project-setup/).

Source: https://zenos-ui.pages.dev/getting-started/installation/