Getting Started

How to get started with Backend AI UI.

Introduction

Backend AI UI is a collection of UI components built on top with shadcn/ui and Tailwind CSS v3.

Add in this monorepo

To usage Backend AI UI components in this monorepo, you need to install the @backend-ai/ui package:

Terminal

npm install @backend-ai/ui

and check if the package.json file has the following entry:

JSON

"dependencies": {
  "@backend-ai/ui": "*"
}

Tailwind CSS v3

This library export a default tailwind.config preset that you can use in your project:

  1. Add backend-ai/tailwind-config to your project dependencies:

Terminal

npm install @backend-ai/tailwind-config -D
  1. Check if the package.json file has the following entry:

JSON

"devDependencies": {
  "@backend-ai/tailwind-config": "*"
}
  1. Create a tailwind.config.ts file in your project root directory and import the tailwind.config preset from @backend-ai/tailwind-config:

TypeScript

import type { Config } from "tailwindcss";

import sharedConfig from "@backend-ai/tailwind-config/tailwind.config";

const tailwindConfig: Pick<Config, "presets"> = {
  presets: [
    {
      ...sharedConfig,
      content: ["./app/**/*.tsx", "./src/**/*.tsx"],
      //...
    },
  ],
};

export default tailwindConfig;

PostCSS

If you want to use the postcss.config.js file, you need to use the shared postcss.config from @backend-ai/ui package:

Only compatible with Tailwind CSS v3.

JavaScript

import postCSSConfig from "@backend-ai/ui/postcss.config";

export default postCSSConfig;