Installation
Add Koala UI to your React app. Run the one-time setup, wire the fonts and theme into your layout, add the components you need, and pull updates later without losing your edits.
Koala UI ships owned source: the CLI copies each component into your repo under components/ui/, so you own and edit the code, no runtime dependency on us. The fastest path is the CLI; you can also copy any component by hand from its docs page. It sets up Next.js and Vite apps alike.
Quick start#
Run the setup
initwrites the design tokens tokoala.cssand imports them from the stylesheet that imports Tailwind (app/globals.cssin Next.js,src/index.cssin Vite), drops the shared helpers (cnand thetvwrapper) intolib/, adds the theme provider and installs the base dependencies. It tells the two frameworks apart on its own. No account or auth needed.On a fresh
create-next-appproject it replaces the starter stylesheet, whose own colors and dark media query would fight Koala’s themes. On an existing stylesheet it only adds the imports, and warns you about anything left that would override the themes: its own--background,--foregroundor--radius, or a dark variant of its own. Coming from shadcn/ui? It replaces shadcn’slib/utils.ts, and the migration guide covers the rest.Wire the fonts and the theme
The theme follows the visitor’s OS by default. Switch it anywhere with
useThemefrom next-themes, which works outside Next.js too. An app with a single theme pins it instead:<ThemeProvider forcedTheme="dark">."use client" import { useTheme } from "next-themes" import { Button } from "@/components/ui/button" // "light" | "cream" | "dark" | "moonlight" | "system" export function MoonlightButton() { const { setTheme } = useTheme() return <Button onClick={() => setTheme("moonlight")}>Moonlight</Button> }Add components
Pass one or more component slugs. Each lands in
components/ui/<name>/(undersrc/in a Vite app) with its dependencies pulled along automatically.Import and use
Import from the path the CLI wrote to. Every component is a named export, themed through tokens, and accepts
className.import { Button } from "@/components/ui/button" export function Example() { return <Button>Get started</Button> }
Updating#
The code is yours, so updates never land on their own. Every install is recorded in koala.json at your project root: which version of each item you took, and a fingerprint of every file as it was written. Commit it with the rest of your code.
See what changed
On its own,
difflists the items with an update and the files you have edited. Name an item to read the line changes before you take them.Apply the update
Files you never touched are replaced. Files you edited are kept as they are and listed, so an update never overwrites your work. Any new dependency an update needs comes along with it.
To take Koala’s version of a file you edited, merge it by hand from the diff, or run npx koalaui-cli@latest update <item> --force to replace your copy outright. init is tracked too, so the tokens in koala.css update the same way.
Pro sections#
Components are free, and so is one sample of every section family (the first variant on its page). Every other section, the page examples and the templates are Pro and need a license key. Activate it once per machine, then add Pro items exactly like free ones.
Activate your license
Lemon Squeezy emails your key with your receipt, and keeps it in your orders. Activating claims one seat and saves the key and the seat to
~/.koalaui/config.json, readable by you only. A bad key fails here, not later.Add a Pro item
Run
npx koalaui-cli@latest listto see everything; Pro items are marked with a lock.
npx koalaui-cli@latest whoami shows the active license and whether this machine is activated. npx koalaui-cli@latest logout releases the seat and forgets the key, so run it before wiping a machine or the seat stays taken.
A license covers one person. Your key is exchanged for the source on our server, so you never receive a repository token and no access is granted to your GitHub account. Every Pro file arrives stamped with a fingerprint of your license, never the key itself.
To read the source before you install it, unlock the site at /account with your key and purchase email: the Code tab of every Pro section then shows its files. Unlocking the site uses no seat.
A few sections link with next/link. In a Vite app add names them after it writes them: swap that import for your router’s link.
Templates#
A template is a whole site: a Next.js project with its pages, its own design layer and the Koala UI components it uses. It is Pro, and it installs into a new, empty folder rather than into a project you already have.
The CLI writes the source, downloads the pictures from the live demo and checks each one against its checksum, then runs npm ci. Start it with npm run dev; its README says where the design variables live and what to replace before you launch. Inside it, npx koalaui-cli@latest update keeps the library files current like in any other project.
CI and agents#
Each login claims a seat, so a CI job must not run one per build. Activate one seat for CI once, from your own machine, without saving it on that machine:
It prints KOALAUI_LICENSE and KOALAUI_INSTANCE. Store both as secrets in your CI and the CLI reads them from the environment. On CI, login refuses to run without --no-save. Coding agents working on your machine use your saved seat and need nothing extra.
Manual installation#
Prefer to copy by hand? Install the shared dependencies, bring the tokens over, then copy any component source straight from its docs page. Hand-copied files are not in koala.json, so the CLI’s update cannot track them.
Install the dependencies
npm install clsx tailwind-merge tailwind-variants tw-animate-css next-themesIn a Vite app, the two faces as well:
npm install @fontsource-variable/inter @fontsource-variable/dm-sansCopy the tokens
The whole theme layer, color roles, radius and shadow scales, motion tokens and the custom utilities, lives in one stylesheet. Copy
registry/koala.cssfrom the repo toapp/koala.css(src/styles/koala.cssin Vite) and import it right after Tailwind. Without it, nothing is styled. In Vite, add the font lines from step 2 of the quick start as well.@import "tailwindcss"; @import "./koala.css";Wire the fonts and the theme
Copy
components/theme-provider.tsxfrom the repo, then set up your root layout (or, in Vite, your entry file) as in step 2 of the quick start.Copy the source
Paste a component into
components/ui/<name>/and point its imports at your project: components pullcnfromlib/utils, thetvwrapper fromlib/tv, and (for multi-part components)createContextfromlib/create-context.
Requirements#
- React 19: components use
refas a regular prop (noforwardRef). - Tailwind CSS v4: the tokens use
@theme,@utilityand@custom-variant, which v3 cannot read. A v3 project has to migrate first. - The
@/*path alias: every component imports through it. Most Next.js projects already have it; a Vite app declares it twice, for TypeScript and for Vite.inittells you if yours doesn’t. - Next.js or Vite:
initrecognizes both and wires each its own way. Any other React 19 + Tailwind v4 setup works too: it finds the stylesheet that imports Tailwind, and the fonts follow the Vite route. Templates are whole Next.js sites.