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).
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:Framework-specific setup
Next.js
Next.js
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.Vite
Vite
For Vite applications, import the CSS in your
main.tsx:main.tsx
Create React App
Create React App
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 || ^19react-dom: ^18 || ^19@types/react: ^18 || ^19 (optional)
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