A modern, themeable React component library built with TypeScript, Tailwind CSS, and a suite of CLI tools to scaffold projects quickly.
⚠️ Alpha Status: This project is in active development. APIs and features may change between releases.
- 🎨 Themeable Components: Switch between light and dark themes effortlessly.
- 🔧 Type-Safe: Built with TypeScript for an excellent developer experience.
- 📦 Modern Stack: React + Tailwind CSS + Radix UI primitives.
- 🎯 Flexible Templates: Create new projects from a variety of templates:
- ssr – Server-side rendered applications (scaffolded under
apps/*
) - spa – Single-page applications (scaffolded under
apps/*
) - db – Package projects (scaffolded under
packages/*
) - cli – Package projects (scaffolded under
packages/*
) - monorepo – Full repository setups at the root
- ssr – Server-side rendered applications (scaffolded under
- 🛠 CLI Tool: Quickly scaffold projects using our CLI commands.
- 💡 Additional Commands:
- Eject components to integrate them directly into your project.
- Copy component snippets directly to your clipboard.
Install Earthling UI via Bun:
bun add earthling-ui
Current components:
Button
: Versatile button with filled, outline, and ghost variantsCard
: Container component for grouping related contentInput
: Text input field with various states and validationTextarea
: Multi-line text inputThemeSwitcher
: Toggle between light and dark themes
Each component supports:
- Variants: filled, outline, ghost
- Sizes: sm, md, lg
- Color schemes: default, primary, secondary, good, bad
import { Button } from "earthling-ui/button";
function App() {
return (
<div>
<Button material="filled" scheme="primary" size="md">
Click me
</Button>
</div>
);
}
Earthling UI supports light, dark, and system themes through data attributes:
/* Import required styles */
@import "tailwindcss";
@import "earthling-ui";
@import "earthling-ui/theme/dark";
/* Apply themes based on data-theme attribute */
@layer base {
:root[data-theme="dark"] {
@apply theme-dark;
}
:root[data-theme="system"] {
@media (prefers-color-scheme: dark) {
@apply theme-dark;
}
}
}
// Manual theme control
document.documentElement.setAttribute("data-theme", "dark"); // or 'light' or 'system'
This is a monorepo managed with Bun workspaces. Key packages:
packages/earthling-ui
: The main UI component libraryapps/pwa
: Demo/documentation site (work in progress)
# Install dependencies
bun install
# Build the UI library and watch for changes
cd packages/earthling-ui
bun run dev
# Run the demo site
cd apps/pwa
bun run dev
MIT © Steven Frady