Installation
Get started with Slipstream UI in your project.
Prerequisites
- Node.js 18 or higher
- pnpm 8 or higher (recommended)
- React 18 or higher
- TypeScript (recommended)
Quick Start with CLI
The fastest way to get started is using the Slipstream UI CLI:
npx slipstream-ui@latest initThis will:
- Install the required packages
- Set up the configuration files
- Add base components to your project
- Configure your theme
Manual Installation
If you prefer to install manually, follow these steps:
1. Install packages
pnpm add @slipstream-ui/core @slipstream-ui/ai @slipstream-ui/themes2. Configure Tailwind CSS
Extend your Tailwind config with the Slipstream UI theme:
// tailwind.config.js
module.exports = {
darkMode: ['class'],
content: [
'./src/**/*.{ts,tsx}',
'./node_modules/@slipstream-ui/**/*.{js,ts,tsx}',
],
theme: {
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
},
},
plugins: [require('tailwindcss-animate')],
}3. Add CSS variables
Add the CSS variables to your global CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 210 100% 50%;
--primary-foreground: 0 0% 100%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 210 100% 50%;
--radius: 0.5rem;
}
.dark {
color-scheme: dark;
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 210 100% 50%;
--primary-foreground: 210 40% 98%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 210 100% 50%;
}
}4. Import components
Start using components in your app:
import { Button } from '@slipstream-ui/core'
import { Message, Conversation } from '@slipstream-ui/ai'
function App() {
return (
<div>
<Button>Click me</Button>
<Conversation messages={messages} />
</div>
)
}Package Managers
Slipstream UI works with all major package managers:
pnpm (recommended)
pnpm add @slipstream-ui/core @slipstream-ui/ainpm
npm install @slipstream-ui/core @slipstream-ui/aiyarn
yarn add @slipstream-ui/core @slipstream-ui/ai