Introduction
MantleUI is a production-grade React component library with 109 components, built-in dark mode, full TypeScript support, and zero CSS-in-JS runtime.
What is MantleUI?
MantleUI is a comprehensive React component library designed for building modern web applications. It provides 109 components across 13 categories, from everyday form controls and feedback elements to advanced 3D visualizations and motion animations. Every component is built from scratch with clean abstractions, composability, and accessibility as first-class priorities.
The library ships as three tree-shakeable entry points. The core package has zero peer dependencies beyond React. 3D and motion components are separate imports with optional peer dependencies, so they never bloat your bundle if you don't use them.
Features
109 Components
Form controls, feedback, navigation, data display, 3D, motion, carousels, and more.
Dark Mode Built-in
ThemeProvider with system detection, localStorage persistence, and instant switching.
Fully Accessible
Keyboard navigation, ARIA attributes, focus management, and screen reader support.
Zero Runtime CSS
Plain CSS with mantle- prefixed classes. No CSS-in-JS, no runtime overhead.
Tree-shakeable
Three separate entry points — core, three, and motion — so optional deps stay optional.
6 Colors + Custom Hex
Built-in blue, red, green, yellow, purple, neutral presets, plus any hex color.
Strict TypeScript
Full type safety with no any escapes. Polymorphic types, prop inference, and strict mode.
676+ Tests
Vitest + React Testing Library. Behavioral tests for rendering, interactions, and accessibility.
Three Entry Points
MantleUI is organized into three separate entry points, each with its own JavaScript bundle and CSS file. This keeps your bundle lean — you only pay for what you import.
@mantleui/react
72 core UI components — forms, feedback, navigation, layout, data display, color pickers, and utilities.
@mantleui/react/three
11 Three.js-powered 3D components — Globe, ParticleField, Vortex, Aurora, and more.
@mantleui/react/motion
25 framer-motion components — animations, 7 carousels, and advanced motion effects.
Design Patterns
MantleUI demonstrates a range of React design patterns used in production component libraries.
| Pattern | Used By |
|---|---|
| Compound Components | Accordion, Tabs, Modal, Dropdown, Card, Breadcrumb, BentoGrid |
| Controlled / Uncontrolled | All form components via useControllable hook |
| Polymorphic as Prop | Button (renders as <a>, <span>, etc.) |
| Render Props | DataTable cells, ListBox renderItem |
| Headless Hooks | usePopover, useDataTable, useToast |
| Context-based Theming | ThemeProvider with useSyncExternalStore |
| Portal Rendering | Modal, Drawer, Toast, Popover, ScrollProgress |
Compound Components
Components like Accordion, Tabs, and BentoGrid use the compound component pattern — a parent component shares state with its children via context.
<Accordion> <Accordion.Item value="faq-1"> <Accordion.Trigger>What is MantleUI?</Accordion.Trigger> <Accordion.Content> A production-grade React component library. </Accordion.Content> </Accordion.Item></Accordion>Controlled & Uncontrolled
Every stateful component works both ways. Use defaultValue for uncontrolled, or value + onChange for controlled.
// Uncontrolled — just works<Select defaultValue="react" options={options} />
// Controlled — full control<Select value={value} onValueChange={setValue} options={options} />Polymorphic Components
The as prop lets you change the rendered element while keeping all component styling and behavior.
// Renders as an <a> tag with full Button styling<Button as="a" href="/about">I'm a link</Button>
// Renders as a <span><Button as="span">I'm a span</Button>Theming & Colors
Every component accepts a color prop for preset or custom hex colors. For deeper customization, override CSS variables directly.
// Every component accepts a color prop<Button color="blue">Blue</Button><Button color="#e94560">Custom Hex</Button>
// Full CSS variable override<Button style={{ "--mantle-bg": "#1a1a2e", "--mantle-border": "#e94560", "--mantle-text": "#ffffff", }}> Fully Custom</Button>Tech Stack
| Layer | Technology |
|---|---|
| Components | React 19, TypeScript 5.9 (strict) |
| Build | tsup (esbuild) — ESM + CJS + DTS |
| Styling | Plain CSS + CSS custom properties |
| Testing | Vitest + React Testing Library |
| 3D (optional) | Three.js + @react-three/fiber + drei |
| Motion (optional) | framer-motion |
| Monorepo | Turborepo + pnpm workspaces |
| CI/CD | GitHub Actions + Vercel |
Next Steps
Ready to start building?