π‘ Summary
Elements is a custom documentation system for creating and managing provider documentation and component demos.
π― Target Audience
π€ AI Roast: βPowerful, but the setup might scare off the impatient.β
Risk: Low. Review: shell/CLI command execution; outbound network access (SSRF, data egress); filesystem read/write scope and path traversal; dependency pinning and supply-chain risk. Run with least privilege and audit before enabling in production.
Elements - Full Stack Components
A custom documentation system for Elements, providing comprehensive provider documentation and component demos in a maintainable, in-house built solution.

π Features
- Custom MDX Documentation System - Built from scratch without fumadocs dependency
- Command+K Search - Fast search functionality across all docs and components
- Smart Table of Contents - Automatic TOC generation with scroll tracking
- Provider-Focused Structure - Organized by provider (Clerk, Stripe, AI SDK, etc.)
- Responsive Design - Mobile-first approach with beautiful UI
- Legacy Component Support - Backwards compatible with existing
/troutes
π Project Structure
src/
βββ app/
β βββ t/[[...slug]]/page.tsx # Main documentation routing system
β βββ globals.css # Global styles and theme configuration
β βββ page.tsx # Main landing page
βββ components/
β βββ command-search.tsx # Command+K search functionality
β βββ table-of-contents.tsx # Auto-generating TOC with scroll tracking
β βββ component-page-template.tsx # Reusable component page template
β βββ ui/ # shadcn/ui components
βββ content/ # MDX documentation files
β βββ ai-sdk.mdx # AI SDK provider documentation
β βββ stripe.mdx # Stripe provider documentation
β βββ [provider].mdx # Additional provider docs
βββ registry/ # Component registry
π Technology Stack
- Next.js 15 - React framework with App Router
- MDX - Markdown with JSX components (
@next/mdx,next-mdx-remote) - TypeScript - Type safety throughout
- Tailwind CSS - Styling with custom design system
- Remark/Rehype - Markdown processing with plugins
- CMDK - Command palette functionality
- Gray Matter - Frontmatter parsing
π Writing Documentation
Creating Provider Pages
Create MDX files in src/content/ for each provider:
--- title: "Provider Name" description: "Brief description of the provider and its components" category: "CATEGORY NAME" brandColor: "#000000" darkBrandColor: "#ffffff" icon: "π―" installCommand: "bunx shadcn@latest add @elements/provider" showRegistryVisualizer: true layout: type: "auto" columns: 2 gap: "lg" features: - icon: "β¨" title: "Feature Name" description: "Feature description" --- # Provider Documentation Your comprehensive provider documentation goes here... ## Installation ```bash npm install provider-package
Components
Component Name
Description and usage examples...
Examples
Real-world usage examples...
### Frontmatter Options
| Field | Type | Description |
|-------|------|-------------|
| `title` | `string` | Provider/component name |
| `description` | `string` | Brief description |
| `category` | `string` | Category for organization |
| `brandColor` | `string` | Primary brand color (hex) |
| `darkBrandColor` | `string` | Dark mode brand color (optional) |
| `icon` | `string` | Emoji or icon identifier |
| `installCommand` | `string` | Installation command |
| `showRegistryVisualizer` | `boolean` | Show component registry visualization |
| `layout.type` | `"auto" \| "custom"` | Layout type |
| `layout.columns` | `1 \| 2 \| 3 \| 4` | Number of columns |
| `layout.gap` | `"sm" \| "md" \| "lg"` | Grid gap size |
| `features` | `array` | List of key features |
## π Search Functionality
The Command+K search provides:
- **Global Search** - Search across all documentation
- **Categorized Results** - Organized by providers, components, and pages
- **Keyboard Navigation** - Full keyboard support
- **Smart Filtering** - Searches titles, descriptions, and categories
### Adding Search Items
Update `src/components/command-search.tsx` to include new documentation:
```typescript
const SEARCH_DATA: SearchItem[] = [
{
id: "new-provider",
title: "New Provider",
description: "Description of the new provider",
url: "/t/new-provider",
type: "provider",
category: "Integration",
},
// ... more items
];
π§ Table of Contents
The TOC component automatically:
- Scans Headings - Finds all h1-h6 elements with IDs
- Creates Navigation - Generates clickable navigation links
- Tracks Scroll - Highlights current section
- Smooth Scrolling - Smooth navigation to sections
Headings are automatically enhanced with anchor links via rehype-slug and rehype-autolink-headings.
π¨ Styling & Theming
Custom Design System
The project uses a custom OKLCH color system:
/* Custom CSS variables in globals.css */ :root { --primary: oklch(0.7 0.15 270); --background: oklch(1 0 0); /* ... more variables */ }
Component Styling
All components support custom styling:
<TableOfContents className="custom-toc-styles" /> <CommandSearch appearance={{ theme: 'custom' }} />
π Migration Guide
From Fumadocs
We've completely removed fumadocs dependencies and built a custom system:
-
Removed Dependencies:
fumadocs-corefumadocs-mdxfumadocs-ui
-
Added Dependencies:
@next/mdxnext-mdx-remotegray-matterremark-gfmrehype-slugrehype-autolink-headings
-
File Changes:
- Removed
src/app/docs/directory - Removed
content/docs/directory - Updated
next.config.tsto use@next/mdx - Created custom routing in
src/app/t/[[...slug]]/page.tsx
- Removed
Legacy Support
The system maintains backwards compatibility with existing /t routes:
/t/clerkβ Uses legacy component/t/new-providerβ Uses new MDX system- Automatic fallback to legacy routes when MDX not found
π Development
Getting Started
# Install dependencies bun install # Start development server bun run dev # Build for production bun run build # Run linting bun run lint # Run type checking bun run typecheck
Adding New Providers
-
Create MDX File:
touch src/content/my-provider.mdx -
Add Frontmatter and Content: Follow the frontmatter schema and write comprehensive documentation.
-
Update Search Index: Add the new provider to
SEARCH_DATAincommand-search.tsx. -
Test Routes: Visit
/t/my-providerto see your documentation.
Component Integration
For interactive components, you can import them directly in MDX:
import { MyComponent } from '@/components/my-component'; # My Provider <MyComponent prop="value" />
π§ Configuration
Next.js Config
The MDX configuration in next.config.ts:
const withMDX = createMDX({ options: { remarkPlugins: [remarkGfm], rehypePlugins: [ rehypeSlug, [rehypeAutolinkHeadings, { behavior: 'wrap' }], ], }, });
Search Configuration
Customize search behavior in command-search.tsx:
// Modify search logic, add new item types, or change categorization const getIcon = (type: SearchItem["type"]) => { // Custom icon logic };
π― Best Practices
Documentation Writing
- Clear Structure - Use consistent heading hierarchy
- Code Examples - Include practical, runnable examples
- Installation Steps - Always provide clear installation instructions
- Error Handling - Document common issues and solutions
- Props Documentation - Use tables for component props
Component Organization
- Provider Focus - Organize by provider/service
- Logical Grouping - Group related components together
- Consistent Naming - Use kebab-case for file names
- Comprehensive Examples - Show real-world usage patterns
Performance
- Static Generation - MDX files are statically generated
- Code Splitting - Components are lazy-loaded when needed
- Search Optimization - Search data is optimized for fast filtering
- Image Optimization - Use Next.js Image component for assets
π Monitoring & Analytics
The system includes Vercel Analytics integration for tracking:
- Page views and navigation patterns
- Search usage and popular queries
- Component installation tracking
- User engagement metrics
π€ Contributing
- Fork the Repository
- Create Feature Branch:
git checkout -b feature/amazing-feature - Write Documentation: Add comprehensive MDX documentation
- Update Search: Add new items to search index
- Test Thoroughly: Ensure all routes work correctly
- Submit Pull Request: Include screenshots and descriptions
Quick Start (Legacy)
- Add Elements registry to your
components.jsonfile:
{ "registries": { "@elements": "https://tryelements.dev/r/{name}.json" } }
- Install any element you want using the
bunx shadcn@latest addcommand.
bunx shadcn@latest add @elements/logos
Available Components
Clerk Auth
Complete authentication flows with sign-in, sign-up, and waitlist components.

Tech Logos
Popular brand logos collection with shopping cart functionality.

Theme Switcher
Dark/light mode toggles with multiple variants.
More coming soon...
Registry
Visit tryelements.dev to browse all components.
Built with β€οΈ by the Crafter Station team for the Elements ecosystem.
Pros
- Customizable MDX documentation system
- Responsive design with a mobile-first approach
- Automatic TOC generation for easy navigation
- Supports legacy components for backward compatibility
Cons
- Requires familiarity with MDX and Next.js
- Limited to the features provided by the framework
- Potentially steep learning curve for new users
- Dependency on multiple libraries may complicate setup
Related Skills
pytorch
SβIt's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.β
agno
SβIt promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.β
nuxt-skills
SβIt's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.β
Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.
Copyright belongs to the original author crafter-station.
