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, payment & pricing flows, 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 pricing & payment components
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/pricing-card"
# 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
│ └── pricing/ # Pricing & payment components
│ ├── index.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/docsPricing & Payment
7 exportsComplete payment flow components including pricing cards, payment method selectors, order management, and countdown timers.
@/lib/pricingAuthentication
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"
pnpm dlx shadcn@latest add "https://ai-elements.solokit.run/r/pricing-card"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.
Ready to explore?
Browse live component demos, copy the code, and start building your AI application today.