Installation
Get started with Soft UI by installing the required packages and configuring your project.Prerequisites
Soft UI requires React 19+ and Next.js 16+ (for Next.js projects). Make sure your project meets these requirements before installing.
Installation Steps
Install packages
Install all three Soft UI packages:
Package Details
| Package | Description | Version |
|---|---|---|
@soft-ui/tokens | Design tokens, CSS entrypoints, and theme helpers | 0.1.0 |
@soft-ui/icons | Icon adapter with Remix Icons implementation | 0.1.0 |
@soft-ui/react | 70+ UI components with subpath imports | 0.1.0 |
Import global styles
Import the Soft UI styles once in your application entry point.For Next.js App Router, add to your root For Next.js Pages Router or Create React App, add to
layout.tsx:app/layout.tsx
_app.tsx or index.tsx:_app.tsx
Configure Tailwind v4
Soft UI components use Tailwind v4 utility classes. Add the source scanning directive to your CSS file.If using Next.js, add to your For Vite or other build tools, ensure your Tailwind config includes the Soft UI package:
globals.css or main CSS file:app/globals.css
src/index.css
Set up theme initialization (Optional)
For theme switching support, add the theme initialization script to your HTML root.In Next.js App Router, update your Available options:
layout.tsx:app/layout.tsx
The theme initialization script prevents flash of unstyled content (FOUC) by applying the correct theme before the page renders. It also handles system preference detection for dark mode.
Theme Configuration
You can customize the default theme settings:- Mode:
"light"|"dark" - Scheme:
"mono"(neutral) |"color"(themed) - Theme colors:
"red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","mauve","mist","olive","taupe" - Base colors:
"neutral","slate","gray","zinc","stone","mauve","mist","olive","taupe"
Peer Dependencies
Soft UI has the following peer dependencies:package.json
Font Setup
Soft UI uses Inter Variable for optimal typography. Install it via Google Fonts in Next.js:app/layout.tsx
Verification
To verify your installation is correct, try importing and using a component:Troubleshooting
Components have no styles
Components have no styles
Make sure you’ve added the
@source directive to your CSS file to scan Soft UI components:TypeScript errors on import
TypeScript errors on import
Soft UI requires TypeScript 5.9.3+. Update your TypeScript version:
Theme flashing on page load
Theme flashing on page load
Make sure the theme initialization script is in the
<head> and runs before the body renders. See Step 4 for details.Next Steps
Quick Start Guide
Build your first component and learn the basics of Soft UI