---
title: Using Angular
description: Easily use Bamboo with Angular with our dedicated integration.
---

## Start a new project

<Steps>

### Create Vite project

To get started, we will need to create a new Angular project using the official
[scaffolding tool](https://angular.dev/tools/cli).

If you don't enter any parameter, the CLI will guide you through the process of creating a new Angular app.

```bash
ng new test-app
```

You will be asked a few questions, answer them as follows:

```bash
? Which stylesheet format would you like to use? CSS
? Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? No
```

### Install Bamboo

Install bamboo and create your `bamboo.config.ts` file.

<Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
  {/* <!-- prettier-ignore-start --> */}
  <Tab>
    ```bash
    pnpm install -D @bamboocss/dev
    pnpm bamboo init
    ```
  </Tab>
  <Tab>
    ```bash
    npm install -D @bamboocss/dev
    npx bamboo init
    ```
  </Tab>
  <Tab>
    ```bash
    yarn add -D @bamboocss/dev
    yarn bamboo init
    ```
  </Tab>
  <Tab>
    ```bash
    bun add -D @bamboocss/dev
    bun bamboo init
    ```
  </Tab>
  {/* <!-- prettier-ignore-end --> */}
</Tabs>

### Configure PostCSS

Create a `postcss.config.json` file in the root of your project and add the following code:

```json filename="postcss.config.json"
{
  "plugins": {
    "@bamboocss/dev/postcss": {}
  }
}
```

> You must use a JSON file for the PostCSS configuration, as the Angular CLI does not support JavaScript PostCSS
> configuration files.

### Update package.json scripts

Add `"prepare": "bamboo codegen"` to `scripts`. It runs [codegen](/docs/references/cli#codegen) after every dependency
install, so the output directory can stay in `.gitignore`.

### Configure the content

Make sure that all of the paths of your Angular components are included in the `include` section of the
`bamboo.config.ts` file.

```js {8,17} filename="bamboo.config.ts"
import { defineConfig } from '@bamboocss/dev'

export default defineConfig({
  // Whether to use css reset
  preflight: true,

  // Where to look for your css declarations
  include: ['./src/**/*.{js,jsx,ts,tsx}'],

  // Files to exclude
  exclude: [],

  // The output directory for your css system
  outdir: 'styled-system',
})
```

### Configure the entry CSS with layers

Add this code to an `src/index.css` file and import it in the root component of your project.

```css filename="src/index.css"
@layer reset, base, tokens, recipes, utilities;
```

## Start your build process

Start the dev server with `ng serve`.

### Start using Bamboo

```typescript filename="src/app.component.ts"
import { Component } from '@angular/core'
import { css } from '../styled-system/css'

@Component({
  selector: 'app-root',
  standalone: true,
  template: ` <div [class]="redBg"></div> `,
})
export class App {
  redBg = css({ bg: 'red.400' })
}
```

</Steps>
