Introduction
What is SoloKit and why should you use it?
SoloKit is an open-source component library designed for building modern AI-powered applications. It provides a comprehensive set of UI components covering AI chatbot interfaces, authentication, and documentation systems.
All components follow the shadcn/ui philosophy — they are not installed as a dependency. Instead, you copy the source code into your project, giving you full ownership and control over every line of code.
Quick Start
Get up and running in under 2 minutes.
Initialize shadcn/ui in your project
pnpm dlx shadcn@latest initThis sets up your components.json and configures Tailwind CSS with the required CSS variables.
Add SoloKit components from the registry
# Add AI chatbot components
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/conversation"
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/message"
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/reasoning"
# Add documentation components
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/doc-layout"Each command copies the component source into your lib/ directory alongside any peer dependencies.
Import and use in your app
import { Conversation, Message, MessageContent } from "@/lib/chatbot";
import { Reasoning, ReasoningTrigger, ReasoningContent } from "@/lib/chatbot";
export default function ChatPage() {
return (
<Conversation>
<Message role="user">
<MessageContent>Hello, what can you do?</MessageContent>
</Message>
<Message role="assistant">
<Reasoning>
<ReasoningTrigger>Thinking...</ReasoningTrigger>
<ReasoningContent>Analyzing user intent...</ReasoningContent>
</Reasoning>
<MessageContent>I can help you build AI applications!</MessageContent>
</Message>
</Conversation>
);
}Installation
Prerequisites and detailed installation steps.
Prerequisites
Install required dependencies
# Core dependencies
pnpm add framer-motion lucide-react clsx tailwind-merge class-variance-authority
# Radix UI primitives (used by multiple components)
pnpm add @radix-ui/react-collapsible @radix-ui/react-dialog @radix-ui/react-tabs
pnpm add @radix-ui/react-tooltip @radix-ui/react-scroll-area @radix-ui/react-slot
# Optional: syntax highlighting for code blocks
pnpm add prismjs react-syntax-highlighter
pnpm add -D @types/prismjs @types/react-syntax-highlighterConfigure the cn() utility
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}All SoloKit components import cn from @/lib/utils. This is the same pattern used by shadcn/ui.
Project Structure
How SoloKit components are organized in your project.
your-project/
├── app/
│ ├── globals.css # Tailwind + CSS variables
│ └── [locale]/
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ └── ui/ # shadcn/ui base components
│ ├── button.tsx
│ ├── dialog.tsx
│ ├── tabs.tsx
│ └── ...
├── lib/
│ ├── utils.ts # cn() utility
│ ├── chatbot/ # AI chatbot components
│ │ ├── index.ts # Public exports
│ │ ├── conversation.tsx # Chat container
│ │ ├── message.tsx # Message bubbles
│ │ ├── reasoning.tsx # Thinking blocks
│ │ ├── data-card.tsx # 11-variant data cards
│ │ ├── tool-invocation.tsx
│ │ ├── sources.tsx
│ │ ├── suggestions.tsx
│ │ ├── code-block.tsx
│ │ ├── web-preview.tsx
│ │ ├── loader.tsx
│ │ └── actions.tsx
│ ├── docs/ # Documentation components
│ │ ├── index.ts
│ │ ├── components/
│ │ │ ├── doc-layout.tsx
│ │ │ ├── sidebar-navigation.tsx
│ │ │ ├── doc-search.tsx
│ │ │ ├── breadcrumb.tsx
│ │ │ ├── table-of-contents.tsx
│ │ │ ├── doc-content.tsx
│ │ │ ├── doc-navigation.tsx
│ │ │ └── code-highlight.tsx
│ │ ├── hooks/
│ │ └── types.ts
├── components.json # shadcn/ui config
├── tailwind.config.ts
└── package.jsonKey insight: Components live in lib/ (not node_modules). You own the source code and can customize everything.
Component Libraries
Four comprehensive libraries for different use cases.
AI Chatbot
11 exportsBuild intelligent conversational interfaces with message bubbles, reasoning blocks, tool invocations, and streaming effects.
@/lib/chatbotDocumentation
10 exportsFull documentation system with layout, sidebar navigation, search, breadcrumbs, table of contents, and MDX support.
@/lib/docsAuthentication
3 exportsLogin, register, and OAuth flow components with prompt dialogs, social login buttons, and password forms.
@/app/components/authUsage Examples
Real-world patterns for common use cases.
AI Chat with Streaming
import {
Conversation,
ConversationContent,
ConversationScrollButton,
} from "@/lib/chatbot/conversation";
import { Message, MessageContent } from "@/lib/chatbot/message";
import { Loader, StreamingCursor } from "@/lib/chatbot/loader";
import { Sources, SourcesTrigger, SourcesContent } from "@/lib/chatbot/sources";
export function ChatInterface({ messages, isLoading }) {
return (
<Conversation className="h-[600px]">
<ConversationContent>
{messages.map((msg) => (
<Message key={msg.id} role={msg.role}>
<MessageContent>{msg.content}</MessageContent>
{msg.sources && (
<Sources>
<SourcesTrigger>{msg.sources.length} sources</SourcesTrigger>
<SourcesContent sources={msg.sources} />
</Sources>
)}
</Message>
))}
{isLoading && <Loader />}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
);
}Documentation Site
import {
DocLayout,
DocContent,
DocBreadcrumb,
DocTableOfContents,
DocNavigation,
} from "@/lib/docs";
import SiteHeader from "@/components/SiteHeader";
import SiteFooter from "@/components/SiteFooter";
export default function DocsPage({ params }) {
return (
<DocLayout
header={<SiteHeader />}
footer={<SiteFooter />}
structureApiEndpoint="/api/docs/structure"
>
<DocBreadcrumb
slug={params.slug}
title={pageTitle}
labels={{ home: "Home", docs: "Docs" }}
/>
<DocContent title={pageTitle} description={pageDescription}>
{compiledMDXContent}
</DocContent>
<DocNavigation
currentSlug={params.slug}
labels={{ prev: "Previous", next: "Next" }}
/>
</DocLayout>
);
}shadcn Registry
How SoloKit integrates with the shadcn/ui registry system.
SoloKit uses the shadcn/ui registry protocol to distribute components. This means you can install any component using the standard shadcn CLI:
# Install a single component
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/[component-name]"
# Examples:
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/conversation"
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/data-card"
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/doc-layout"What the CLI does
- Copies component source to your project
- Installs required npm dependencies
- Resolves and adds peer components
- Follows your
components.jsonconfig
components.json
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib"
}
}Tip: You can also manually copy component files from the SoloKit repository. The registry CLI is just a convenience wrapper. Learn more about the shadcn CLI →
Configuration
Tailwind CSS and path alias configuration.
Tailwind CSS Configuration
import type { Config } from "tailwindcss";
const config: Config = {
darkMode: "class",
content: [
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./lib/**/*.{js,ts,jsx,tsx,mdx}", // Include lib/ for SoloKit components
],
theme: {
extend: {
fontFamily: {
sans: ["var(--font-dm-sans)", "sans-serif"],
display: ["var(--font-outfit)", "sans-serif"],
},
colors: {
border: "rgb(var(--border))",
background: "rgb(var(--background))",
foreground: "rgb(var(--foreground))",
primary: {
DEFAULT: "rgb(var(--primary))",
foreground: "rgb(var(--primary-foreground))",
},
// ... other shadcn/ui color tokens
},
},
},
};
export default config;TypeScript Path Aliases
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}SoloKit components use @/ path alias to reference utilities and other components. Make sure this is configured in your tsconfig.json.
Theming
Customize colors, fonts, and visual style.
SoloKit uses CSS variables for theming, following the shadcn/ui convention. Override these variables in your globals.css to customize the look and feel.
@layer base {
:root {
--background: 255 255 255;
--foreground: 15 23 42;
--primary: 37 99 235;
--primary-foreground: 248 250 252;
--secondary: 241 245 249;
--secondary-foreground: 51 65 85;
--muted: 248 250 252;
--muted-foreground: 100 116 139;
--accent: 241 245 249;
--accent-foreground: 51 65 85;
--destructive: 239 68 68;
--border: 226 232 240;
--ring: 37 99 235;
--radius: 0.75rem;
}
.dark {
--background: 3 7 18;
--foreground: 248 250 252;
--primary: 59 130 246;
--primary-foreground: 3 7 18;
--border: 30 41 59;
/* ... */
}
}Try the Theme Editor
Use our built-in Theme Editor to visually customize your design tokens and export the CSS.
Pro Template
Full-stack Next.js SaaS starter — deploy to Vercel in one click.
The SoloKit Pro Template is a complete, production-ready Next.js application that integrates all SoloKit component libraries into a cohesive SaaS starter. It includes:
Authentication
OAuth (Google, GitHub) + email/password login & registration
AI Chatbot
Full chat UI with reasoning, tools, sources & streaming
Documentation
MDX-powered docs with sidebar, search & ToC
Theme System
Custom design tokens from the Theme Editor applied
i18n + Deploy
Multi-language support, Vercel one-click deploy
Important: Third-party services required
The authentication features in the template require configuration with third-party platforms. You will need to create accounts and obtain API keys from:
- Google Cloud Console — for Google OAuth login
- GitHub Developer Settings — for GitHub OAuth login
See the Auth Setup section below for detailed instructions.
Auth Setup
Configure third-party OAuth and authentication providers.
The template's authentication system supports Google OAuth, GitHub OAuth, and email/password login. OAuth providers require you to register your application with the respective platforms to obtain Client ID and Client Secret credentials.
Recommended: Use NextAuth.js (Auth.js) or Clerk for production auth. The template UI components work with any auth backend.
Google OAuth Setup
Create a Google Cloud project
Go to Google Cloud Console and create a new project (or select an existing one). Navigate to APIs & Services → Credentials.
Configure the OAuth consent screen
Set up the OAuth consent screen with your application name, support email, and authorized domains. For development, you can use localhost as an authorized domain.
Create OAuth 2.0 Client ID
Click Create Credentials → OAuth client ID. Set the application type to “Web application” and configure the redirect URIs:
# Authorized redirect URIs
http://localhost:3000/api/auth/callback/google # Development
https://your-app.vercel.app/api/auth/callback/google # ProductionAdd credentials to environment variables
# .env.local
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secretGitHub OAuth Setup
Register a new OAuth App
Go to GitHub → Settings → Developer Settings → OAuth Apps and click New OAuth App.
Configure the application
Application name: Your App Name
Homepage URL: http://localhost:3000
Authorization callback URL: http://localhost:3000/api/auth/callback/github
# For production, update the URLs:
Homepage URL: https://your-app.vercel.app
Authorization callback URL: https://your-app.vercel.app/api/auth/callback/githubAdd credentials to environment variables
# .env.local
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secretComplete Auth Environment Variables
# .env.local — Authentication
# ---------------------------------
# NextAuth.js / Auth.js
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-random-secret-key # Generate: openssl rand -base64 32
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# GitHub OAuth
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# Optional: Email provider (for magic links)
EMAIL_SERVER_HOST=smtp.example.com
EMAIL_SERVER_PORT=587
EMAIL_SERVER_USER=your-email@example.com
EMAIL_SERVER_PASSWORD=your-email-password
EMAIL_FROM=noreply@your-app.comDeploy to Vercel
One-click deploy and environment variable configuration.
The template is optimized for Vercel deployment. Push to GitHub and connect the repository to Vercel, or use the one-click deploy button included in the template.
Push to a GitHub repository
# Initialize and push
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/your-name/your-app.git
git push -u origin mainImport to Vercel
Go to vercel.com/new and import your GitHub repository. Vercel will auto-detect the Next.js framework.
Configure environment variables
In the Vercel project settings, add all required environment variables under Settings → Environment Variables:
# Required for all deployments
NEXTAUTH_URL=https://your-app.vercel.app
NEXTAUTH_SECRET=<generate-a-secure-random-string>
# Authentication (at least one provider)
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
# Payment (Stripe at minimum)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
# API (if using external backend)
NEXT_PUBLIC_API_BASE_URL=https://your-api.example.comDeploy and verify
Click Deploy. Vercel will build and deploy your application. After deployment, verify that OAuth redirect URLs and Stripe webhook URLs are updated to your production domain.
Production Checklist
Update OAuth redirect URLs to production domain
AuthSwitch Stripe from test to live API keys
PaymentAdd Stripe webhook for production domain
PaymentSet NEXTAUTH_URL to production URL
AuthGenerate a strong NEXTAUTH_SECRET
AuthConfigure custom domain in Vercel
DeployEnable Vercel Analytics (optional)
DeploySet up error monitoring (e.g. Sentry)
DeploySkip the setup, start shipping
Get the complete SaaS starter with auth, payments, AI chatbot & docs. All components pre-integrated with your custom theme.