Skip to main content

Prerequisites

Before installing Apsara, make sure you have:
  • Node.js 22 or higher installed on your system
  • A React project with React 18 or 19
  • Package manager: npm, yarn, or pnpm
Apsara requires React 18+ and Node.js 22+ to work properly.

Install the package

Install Apsara using your preferred package manager:

Import styles

Apsara uses vanilla CSS for styling. You need to import the CSS file in your application root (e.g., main.tsx, App.tsx, or _app.tsx).
1

Import the CSS file

Add the following import at the top of your root file:
The CSS import should be done once at the root of your application.
2

Optional: Import normalize CSS

For consistent cross-browser styling, you can also import the normalize CSS:

TypeScript setup

Apsara is written in TypeScript and includes comprehensive type definitions. No additional setup is required - types are automatically included when you install the package.
The @types/react peer dependency is optional. TypeScript will work with or without it.

Package exports

Apsara provides several entry points for different use cases:

Basic setup example

Here’s a complete example of setting up Apsara in a React application:
1

Install the package

2

Import styles in your root file

App.tsx
3

Start using components

Import and use any Apsara component in your application:

Framework-specific setup

For Next.js applications, import the CSS in your root layout or _app.tsx:
app/layout.tsx
If using the Pages Router, import in pages/_app.tsx instead.
For Vite applications, import the CSS in your main.tsx:
main.tsx
For Create React App, import the CSS in your index.tsx or App.tsx:
index.tsx

Peer dependencies

Apsara has the following peer dependencies:
  • react: ^18 || ^19
  • react-dom: ^18 || ^19
  • @types/react: ^18 || ^19 (optional)
Make sure your project meets these peer dependency requirements to avoid compatibility issues.

Next steps

Now that you have Apsara installed, you’re ready to start building!

Quick start

Follow the quick start guide to build your first component

Theming

Learn how to customize the look and feel

Components

Browse the complete component library

Dark mode

Set up dark mode in your application