A curated collection of production-ready UI components and micro-interactions built with React, TypeScript, and modern design principles. Each craft is meticulously documented in a diary-style format with live demos, source code, and design notes.
Craft Diary is a component diary system that treats UI components as craft entries. It's built on a file-based architecture where each component automatically becomes a discoverable entry with:
- Live interactive previews with side-by-side code viewing
- Complete source code in an elegant code drawer
- MDX-powered documentation for design decisions and usage notes
- Copy-paste ready - no npm install required, just grab and go
- Automatic discovery - drop a component file and it's instantly available
- 📖 Diary System - File-based component discovery with automatic metadata extraction
- 🎨 Beautiful by default - Modern design with dark mode support
- ♿ Fully accessible - ARIA compliant with keyboard navigation
- 📱 Responsive - Split-panel layout adapts to any screen size
- 🎭 Animated - Smooth transitions and micro-interactions
- 🔧 Customizable - Built with Tailwind CSS and CSS variables
- 📚 MDX Documentation - Write docs alongside your components
The Diary System automatically discovers and organizes your components:
- Drop a component in
craft/components/{name}.tsx - Add metadata in
registry.ts(optional - title/category) - Write docs in
content/crafts/{name}.mdx(optional) - Create examples in
craft/example/{name}.tsx(optional) - It's live! Visit
/diaryto see your new craft entry
The diary system reads your files and generates:
- A gallery page at
/diarygrouped by category - Individual craft pages at
/crafts/{slug} - Code drawers with syntax highlighting
- Automatic component metadata extraction
- ActionBar - Flexible floating action bar with dock and contextual modes
- GooeySearchBar - Animated search bar with gooey blob effects
craft/
├── components/ # Source components (copy from here)
│ ├── action-bar.tsx
│ ├── gooey-search-bar.tsx
│ └── README.md # Component development guide
└── example/ # Demo implementations
└── action-bar-demo.tsx
content/crafts/ # MDX documentation
├── action-bar.mdx
└── gooey-search-bar.mdx
app/
├── (landing)/ # Homepage
└── (diary)/ # Diary route group
├── diary/ # Gallery view (lists all crafts)
├── crafts/[slug]/ # Individual craft pages
└── playground/ # Interactive testing ground
diary.ts # Core diary system (file discovery)
registry.ts # Craft metadata registry
# Install dependencies
bun install
# Run development server
bun devOpen http://localhost:3000/diary to browse the craft diary.
- Browse the craft diary
- Click on any craft to see live preview and documentation
- Click "Component" or "Example" buttons to view code in the drawer
- Copy the source code directly from the drawer
- Paste into your project and customize
Each component is self-contained with minimal dependencies.
# 1. Create component file
craft/components/my-component.tsx
# 2. Register in registry.ts
"my-component": {
slug: "my-component",
title: "My Component",
category: "UI"
}
# 3. (Optional) Add documentation
content/crafts/my-component.mdx
# 4. (Optional) Add example
craft/example/my-component-demo.tsxThe diary system handles the rest automatically!
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- Components: Radix UI primitives
- Documentation: MDX (@next/mdx, @mdx-js/react)
- Icons: Hugeicons + Lucide React
- Animations: Motion (Framer Motion fork)
- Package Manager: Bun
The diary system (diary.ts) provides:
getAllCraftSlugs()- Discover all componentsgetCraftBySlug(slug)- Load component with code, examples, docsgetAllCrafts()- Get all crafts with metadatagetCraftsByCategory()- Organized by categorysearchCrafts(query)- Search across title/slug/category
Automatically extracts:
- Component titles from displayName or export names
- Categories from MDX frontmatter
- File paths and source code
When creating new crafts, follow these principles:
- File-based discovery - Drop component in
craft/components/and it's auto-discovered - shadcn/ui patterns - Composable, unstyled primitives with variants
- Accessibility first - Proper ARIA labels and keyboard navigation
- TypeScript strict mode - Fully typed with exported interfaces
- Responsive design - Mobile-first approach
- Performance conscious - Optimized animations and minimal rerenders
See craft/components/README.md for detailed guidelines.
MIT - Feel free to use in your projects
Built with ❤️ by Rohit Singh Rawat