# Installation

> Add the package, import the styles and wrap your app in a theme.

## Install the package

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Set up with an agent

Paste this prompt into Claude Code, Codex, Gemini CLI, Cursor or another coding agent. It installs the package, adds the brand-design skill and starts the brand workflow.

```text
Set up Brand Studio in this project.

1. Install the components: npm install @brand-studio/ui
2. Import '@brand-studio/ui/styles.css' once and wrap the app in <BrandTheme> from '@brand-studio/ui'.
3. Add the brand-design skill for this coding agent (Claude Code, Codex, Gemini CLI, Cursor, Copilot and others):
   npx skills add hungduong-projects/brand-studio --skill brand-design -y
4. In a new session, use the brand-design skill to write the brand contract, then design the first page with the components.

Docs: https://brandstudio.js.org/docs/
Examples: https://brandstudio.js.org/examples/
```

To add only the skill, run the command for your agent:

```sh
# Any agent that reads Agent Skills
npx skills add hungduong-projects/brand-studio --skill brand-design

# Claude Code plugin
claude plugin marketplace add hungduong-projects/brand-studio
claude plugin install brand-studio@brand-studio-local

# Codex plugin
codex plugin marketplace add hungduong-projects/brand-studio
codex plugin add brand-studio@brand-studio-local

# Gemini CLI
gemini skills install https://github.com/hungduong-projects/brand-studio.git --path plugins/brand-studio/skills/brand-design
```

## Add a brand palette

A palette holds light and dark tokens. The brand-design workflow in Brand Studio writes one to `brand.json`; you can also write it by hand.

```json
{
  "tokens": {
    "light": { "surface": "#f4f5f7", "elevated": "#ffffff", "ink": "#171c29", "muted": "#505b70", "accent": "#234bc2", "onAccent": "#ffffff", "line": "#8a93a5", "font": "Manrope, sans-serif", "radius": "6px" },
    "dark": { "surface": "#11151f", "elevated": "#1a2030", "ink": "#eef1f6", "muted": "#a7b0c2", "accent": "#8fa8ff", "onAccent": "#11151f", "line": "#3a4458", "font": "Manrope, sans-serif", "radius": "6px" }
  }
}
```

## Use a component

```tsx
import { BrandTheme, Button } from '@brand-studio/ui';
import '@brand-studio/ui/styles.css';
import brand from './brand.json';

export default function App() {
  return (
    <BrandTheme palette={brand.tokens} mode="system">
      <Button>Save changes</Button>
    </BrandTheme>
  );
}
```

The package supports React 18 and 19. Components are client components; in the Next.js App Router you can render them from server components.

Source: https://brandstudio.js.org/docs/installation/
