# Installation

> Install the Birch UI packages for each product and framework, and choose between auto-injected styles and a CSS import.

All Birch UI packages are published to npm under the `@birchui` scope. They are ESM only, ship their own TypeScript types and have no runtime dependencies apart from each other (and `@noble/ed25519` inside the license package).

## Pick your packages

Install the engine for the product you use, plus the adapter for your framework. Plain JavaScript and TypeScript apps need only the engine.

### Birch UI Grid (free)

**npm**

```bash
npm install @birchui/core
```

**pnpm**

```bash
pnpm add @birchui/core
```

**yarn**

```bash
yarn add @birchui/core
```

### Grid Pro

Grid Pro builds on the free grid. The Excel Engine and the license package are installed with it as dependencies, so you do not list them yourself.

**npm**

```bash
npm install @birchui/core @birchui/grid-pro
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/grid-pro
```

**yarn**

```bash
yarn add @birchui/core @birchui/grid-pro
```

### Pivot Studio

Pivot Studio renders its pivot table with Birch UI Grid and exports through the Excel Engine; both are installed with it. Add `@birchui/charts` only if you use pivot charts from the `@birchui/pivot-studio/charts` entry point.

**npm**

```bash
npm install @birchui/core @birchui/pivot-studio
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/pivot-studio
```

**yarn**

```bash
yarn add @birchui/core @birchui/pivot-studio
```

### Excel Engine on its own

Use the Excel Engine without a grid to generate or read `.xlsx` files in the browser, in a worker or in Node.

**npm**

```bash
npm install @birchui/excel
```

**pnpm**

```bash
pnpm add @birchui/excel
```

**yarn**

```bash
yarn add @birchui/excel
```

### Scheduler

**npm**

```bash
npm install @birchui/core @birchui/scheduler
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/scheduler
```

**yarn**

```bash
yarn add @birchui/core @birchui/scheduler
```

### Gantt

The Gantt shares its time axis with the Scheduler package, which is installed with it as a dependency. Its task grid is the free Birch UI Grid, and neither a Scheduler nor a Grid Pro license is needed.

**npm**

```bash
npm install @birchui/gantt
```

**pnpm**

```bash
pnpm add @birchui/gantt
```

**yarn**

```bash
yarn add @birchui/gantt
```

### Event Calendar

**npm**

```bash
npm install @birchui/calendar
```

**pnpm**

```bash
pnpm add @birchui/calendar
```

**yarn**

```bash
yarn add @birchui/calendar
```

### Charts

**npm**

```bash
npm install @birchui/core @birchui/charts
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/charts
```

**yarn**

```bash
yarn add @birchui/core @birchui/charts
```

### Diagram

**npm**

```bash
npm install @birchui/core @birchui/diagram
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/diagram
```

**yarn**

```bash
yarn add @birchui/core @birchui/diagram
```

### Spreadsheet

The Spreadsheet reads and writes `.xlsx` files through the Excel Engine, which is installed with it as a dependency.

**npm**

```bash
npm install @birchui/core @birchui/spreadsheet
```

**pnpm**

```bash
pnpm add @birchui/core @birchui/spreadsheet
```

**yarn**

```bash
yarn add @birchui/core @birchui/spreadsheet
```

### Forms and the Form Builder

The free renderer and the paid Form Builder ship in one package. Import the renderer from `@birchui/forms` and the builder from `@birchui/forms/builder`.

**npm**

```bash
npm install @birchui/forms
```

**pnpm**

```bash
pnpm add @birchui/forms
```

**yarn**

```bash
yarn add @birchui/forms
```

## Framework adapters

Each adapter wraps every product. The grid component comes from the main entry point; the scheduler component comes from the `/scheduler` subpath, so grid-only apps never load scheduler code.

| Framework | Package | Peer dependency | Grid import | Scheduler import |
| --- | --- | --- | --- | --- |
| React | `@birchui/react` | `react` and `react-dom` 18 or later | `BirchGrid` from `@birchui/react` | `BirchScheduler` from `@birchui/react/scheduler` |
| Vue | `@birchui/vue` | `vue` 3.3 or later | `BirchGrid` from `@birchui/vue` | `BirchScheduler` from `@birchui/vue/scheduler` |
| Angular | `@birchui/angular` | `@angular/core` 17.3 or later | `BirchGridComponent` from `@birchui/angular` | `BirchSchedulerComponent` from `@birchui/angular/scheduler` |
| Svelte | `@birchui/svelte` | `svelte` 5 or later | `BirchGrid` and the `birchGrid` action from `@birchui/svelte` | `BirchScheduler` from `@birchui/svelte/scheduler` |
| Solid | `@birchui/solid` | `solid-js` 1.8 or later | `BirchGrid` from `@birchui/solid` | `BirchScheduler` from `@birchui/solid/scheduler` |
| Web Component | `@birchui/element` | none | `defineBirchGrid()` from `@birchui/element` | `defineBirchScheduler()` from `@birchui/element/scheduler` |

For example, a React app that uses Grid Pro:

```bash
npm install @birchui/core @birchui/grid-pro @birchui/react
```

`@birchui/scheduler` is an optional peer dependency of every adapter. Install it only when you use the scheduler component.

The Svelte components ship as `.svelte` source and are resolved through the `svelte` export condition, which Vite and SvelteKit use by default.

The adapters have no entry points for Pivot Studio, Gantt, the Event Calendar, Charts, Diagram, Spreadsheet or Forms. Use `createPivotStudio`, `createGantt`, `createCalendar`, `createChart`, `createDiagram`, `createSpreadsheet`, `createForm` and `createFormBuilder` directly, or wrap `pivotStudioDefinition`, `ganttDefinition`, `calendarDefinition`, `chartDefinition`, `diagramDefinition`, `spreadsheetDefinition`, `formDefinition` or `formBuilderDefinition` with your adapter's factory (`createReactComponent`, `createVueComponent`, `createSolidComponent`, `createSvelteAction` or `createElementRegistration`). Each framework guide shows how. See the [Pivot Studio](https://docs.birchui.com/pivot-studio/overview.md), [Gantt](https://docs.birchui.com/gantt/overview.md), [Event Calendar](https://docs.birchui.com/calendar/overview.md), [Charts](https://docs.birchui.com/charts/overview.md), [Diagram](https://docs.birchui.com/diagram/overview.md), [Spreadsheet](https://docs.birchui.com/spreadsheet/overview.md) and [Forms](https://docs.birchui.com/forms/overview.md) overviews.

## Styles

Every widget needs its stylesheet. You can let Birch UI inject it, or import the CSS file yourself.

### Auto-injected styles (default)

When you create a grid or scheduler, Birch UI adds a single `<style>` element to the document head with the widget's CSS. It is added once per page, no matter how many widgets you create. There is nothing to configure.

### Importing the CSS file

If your bundler already handles CSS, or your Content Security Policy does not allow inline styles, import the stylesheet and turn injection off:

```ts title="main.ts"
import '@birchui/core/styles.css';
import '@birchui/grid-pro/styles.css';
import { createGrid } from '@birchui/core';

const grid = createGrid(document.querySelector('#orders')!, {
  columns: [{ field: 'customer', header: 'Customer' }],
  injectStyles: false,
});
```

The packages that ship a stylesheet are `@birchui/core`, `@birchui/grid-pro`, `@birchui/scheduler`, `@birchui/pivot-studio`, `@birchui/gantt`, `@birchui/calendar`, `@birchui/charts`, `@birchui/diagram`, `@birchui/spreadsheet` and `@birchui/forms`, each at `<package>/styles.css`. Every widget accepts `injectStyles: false`.

> **Strict Content Security Policy**
>
> A policy with `style-src 'self'` and no `'unsafe-inline'` blocks injected `<style>` elements. Import the CSS files instead and set `injectStyles: false`. Birch UI never loads fonts, images or scripts from a network location.

## Requirements

- **Browsers:** current versions of Chrome, Edge, Firefox and Safari. Birch UI uses `ResizeObserver`, CSS custom properties and `position: sticky`.
- **Bundlers:** any ESM-aware bundler, such as Vite, webpack 5, Rollup, esbuild, Next.js, Nuxt, the Angular CLI or SvelteKit. There is no CommonJS build.
- **TypeScript:** types are included. Use `"moduleResolution": "bundler"` or `"node16"` so the `exports` map and the `/scheduler` subpaths resolve.
- **Server rendering:** importing any package is safe on the server. Create widgets only in the browser; each framework guide shows where.

## Adding a license key

Paid packages work without a key. Grid Pro, Pivot Studio, the scheduler, the Gantt, the event calendar, Charts, Diagram, the Spreadsheet and the Form Builder show a watermark on non-local hosts, and the Excel Engine logs a console warning. The form renderer is MIT and never checks a key. When you have bought a license, set the key once at startup:

```ts title="main.ts"
import { setLicenseKey } from '@birchui/license';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);
```

In a web worker that runs the Excel Engine, set the key inside the worker as well, or pass `{ licenseKey }` to `writeXlsx` and `readXlsx`. See [Licensing and activation](https://docs.birchui.com/getting-started/licensing.md) for every option.

## Next steps

- Build your first grid with the [Quick start](https://docs.birchui.com/getting-started/quick-start.md).
- Read the guide for your framework: [React](https://docs.birchui.com/frameworks/react.md), [Vue](https://docs.birchui.com/frameworks/vue.md), [Angular](https://docs.birchui.com/frameworks/angular.md), [Svelte](https://docs.birchui.com/frameworks/svelte.md), [Solid](https://docs.birchui.com/frameworks/solid.md) or [Web Component](https://docs.birchui.com/frameworks/web-component.md).
