earthling-ui
v1.1.0-alpha.37
Published
A modern, themeable React component library built with TypeScript, Tailwind CSS, and Radix UI primitives.
Readme
Earthling UI
A modern, themeable React component library built with TypeScript, Tailwind CSS, and Radix UI primitives.
Alpha Status: This project is in active development. APIs and features may change between releases.
Features
- Themeable Components: Light and dark themes with CSS custom properties
- Type-Safe: Built with TypeScript for full IntelliSense support
- Modern Stack: React 18/19 + Tailwind CSS 4 + Radix UI primitives
- Tree-Shakeable: Import only the components you need
- SSR Ready: All components include
"use client"directives for Next.js App Router - CLI Tool: Scaffold projects from templates (SSR, SPA, monorepo, CLI, DB)
- Eject: Copy component source directly into your project
Installation
bun add earthling-ui
# or
npm install earthling-uiComponents
Form Inputs
Button- Versatile button with paper, outline, and ghost materialsInput- Text input fieldTextArea- Multi-line text inputCheckbox- Accessible checkboxRadio- Radio group and radio itemsSwitch- Toggle switchSelect- Dropdown select with compound componentsSlider- Range slider
Layout & Containers
Card- Container for grouping related contentSurface- Flexible surface with paper/glass variantsTable- Data table with compound componentsScrollArea- Scrollable area with custom scrollbarSeparator- Visual dividerTabs- Tab interface
Overlays
Dialog- Modal dialog with form supportAlertDialog- Confirmation dialogDrawer- Slide-out drawer (top/bottom/left/right)Popover- Floating popoverHoverCard- Hover-activated cardTooltip- Accessible tooltipDropdownMenu- Dropdown menu with nested itemsContextMenu- Right-click context menu
Feedback & Display
Alert- Alert message with severity variantsBadge- Small label/tagChip- Interactive tagAvatar- User avatar with fallbackSkeleton- Loading placeholderProgress- Progress barToast- Toast notificationsAccordion- Expandable sectionsCollapsible- Simple collapsible sectionBreadcrumbs- Navigation breadcrumb trailToggleGroup- Button toggle group
Variant System
Components support a consistent variant system:
- Materials:
paper,outline,ghost - Schemes:
primary,secondary,tertiary,neutral,muted,good,caution,bad - Sizes:
sm,md,lg
Usage
Import components individually for optimal tree-shaking:
import { Button } from "earthling-ui/button";
import { Input } from "earthling-ui/input";Or import from the barrel export:
import { Button, Input } from "earthling-ui";function App() {
return (
<Button material="paper" scheme="primary" size="md">
Click me
</Button>
);
}Theming
Earthling UI supports light, dark, and system themes through CSS custom properties:
/* 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/docs: Documentation site
# Install dependencies
bun install
# Build the UI library and watch for changes
cd packages/earthling-ui
bun run dev
# Run the documentation site
cd apps/docs
bun run devLicense
MIT © Steven Frady
