Skip to content

Lesson 1 of 6

Installation

Add comp0 once, then take every public component from the same front door.

Install the package

Your app needs the React package before it can use its components. Run this in the app folder, not inside the component library. After that, your package manager records comp0 as something your app depends on.

Add thisbash
pnpm add @comp0/react

Use one root-only import

Every supported component comes from @comp0/react. This is the public front door even when implementation files move around. Import the names you need, then use them like normal React components.

Add thistsx
import { Button, TextField } from "@comp0/react";

<Button>Save</Button>

Start with one small component

Pick one job, such as saving a form, and add the matching component. comp0 is headless, so it gives you behavior and HTML meaning but not a finished visual theme. Style it with Tailwind utility classes after the behavior makes sense — every example in these docs does the same.

Add thistsx
<Button className="rounded-lg bg-teal-700 px-3 py-2 text-sm font-medium text-white hover:bg-teal-800">
  Save
</Button>