1.1.0-alpha.24 • Published 1 year ago
earthling-ui v1.1.0-alpha.24
Earthling UI
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.
Features
- 🎨 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.
Installation
Install Earthling UI via Bun:
bun add earthling-uiComponents
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
Usage
import { Button } from "earthling-ui/button";
function App() {
return (
<div>
<Button material="filled" scheme="primary" size="md">
Click me
</Button>
</div>
);
}Theming
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'Development
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 devLicense
MIT © Steven Frady
1.1.0-alpha.24
1 year ago
1.1.0-alpha.23
1 year ago
1.1.0-alpha.22
1 year ago
1.1.0-alpha.20
1 year ago
1.1.0-alpha.19
1 year ago
1.1.0-alpha.18
1 year ago
1.1.0-alpha.17
1 year ago
1.1.0-alpha.11
1 year ago
1.1.0-alpha.10
1 year ago
1.1.0-alpha.15
1 year ago
1.1.0-alpha.9
1 year ago
1.1.0-alpha.14
1 year ago
1.1.0-alpha.13
1 year ago
1.1.0-alpha.7
1 year ago
1.1.0-alpha.12
1 year ago
1.1.0-alpha.8
1 year ago
1.1.0-alpha.16
1 year ago
1.1.0-alpha.1
1 year ago
1.1.0-alpha.2
1 year ago
1.1.0-alpha.0
1 year ago
1.1.0-alpha.6
1 year ago
1.1.0-alpha.3
1 year ago
1.1.0-alpha.4
1 year ago
1.0.0-alpha.0
2 years ago