# Installation

Set up a React and Tailwind project, then add your first component.

## Requirements

A React 19 project with Tailwind CSS v4 and TypeScript, such as a new Vite app. Plumbago reads your `tsconfig.json` to find an `@/` path alias, and uses relative imports when there isn't one.

## Set up

1. ### Create a project
   
   ```sh
   npm create vite@latest my-app -- --template react-ts
   ```
2. ### Add Tailwind CSS
   
   ```sh
   npm install tailwindcss @tailwindcss/vite
   ```
   
   Add the `tailwindcss()` plugin to `vite.config.ts` and put `@import "tailwindcss";` at the top of `src/index.css`.
3. ### Run init
   
   ```sh
   npx plumbago init
   ```
   
   It writes `plumbago.json`, copies the theme next to your CSS file and imports it, and adds the `cn` helper. To start with your own accent, grays, corners, density, menus and fonts, make a code on the [Create page](https://plumbago.ochotzas.com/create.md) and run `npx plumbago init --preset <code>` instead.
4. ### Add components
   
   ```sh
   npx plumbago add button sheet
   ```
5. ### Use them
   
   ```tsx
   import { Button } from "@/components/ui/button"
   
   export function App() {
     return <Button>Save changes</Button>
   }
   ```

Working with Claude Code, Cursor or another agent? Give it the Plumbago skill or MCP server so it adds components instead of writing its own. See [AI agents](https://plumbago.ochotzas.com/agents.md).

## Fonts

The theme uses Figtree, or the fonts your preset picks for text and headings, and falls back to the system font. `init` and `apply` put the matching line at the top of your CSS file for you (the System font needs none). If you set things up by hand, add it above the Tailwind import.

```css
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap");
```
