Framework-agnostic React component library with Atomic Design principles
- Framework Agnostic - Pure React components, no Next.js or routing dependencies
- Atomic Design - Organized atoms, molecules, and organisms
- TypeScript First - Full type safety and IntelliSense support
- Tailwind CSS - Utility-first styling with customizable design tokens
- Storybook - Interactive component documentation
- Tree-shakeable - Import only what you need
- Accessible - WCAG compliant components
# npm
npm install @atomos/ui
# pnpm
pnpm add @atomos/ui
# yarn
yarn add @atomos/ui{
"react": "^18.0.0",
"react-dom": "^18.0.0"
}import { Button, Card, Input, Spinner } from '@atomos/ui'
function App() {
return (
<Card variant="elevated" padding="lg">
<h2>Welcome to Atomos UI</h2>
<Input placeholder="Enter your email" />
<Button variant="primary" size="lg">
Get Started
</Button>
</Card>
)
}import {
FormProvider,
FormInput,
FormSelect,
FormTextarea,
FormCheckbox,
FormField,
} from '@atomos/ui'
function ContactForm() {
const fields: FormField[] = [
{
name: 'name',
value: '',
label: 'Full Name',
validation: { required: true, minLength: 2 },
isValid: false,
},
{
name: 'email',
value: '',
label: 'Email',
validation: { required: true, pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ },
isValid: false,
},
{
name: 'message',
value: '',
label: 'Message',
validation: { required: true, minLength: 10 },
isValid: false,
},
{
name: 'subscribe',
value: false,
label: 'Subscribe to newsletter',
validation: {},
isValid: true,
},
]
const handleSubmit = (fields: FormField[]) => {
console.log('Form submitted:', fields)
}
return (
<FormProvider
initialFields={fields}
onSubmit={handleSubmit}
onSuccess={(msg) => alert(msg)}
onError={(err) => console.error(err)}
submitLabel="Send Message"
>
<FormInput id="name" placeholder="John Doe" />
<FormInput id="email" type="email" placeholder="john@example.com" />
<FormTextarea id="message" rows={5} placeholder="Your message..." />
<FormCheckbox id="subscribe" helpText="Get updates about new features" />
</FormProvider>
)
}import { getButtonStyles, ButtonVariant } from '@atomos/ui'
const customButton = getButtonStyles('primary', 'lg', true)Inputs & Controls:
Button- Versatile button with variants and statesCheckbox- Checkbox inputIconButton- Icon-only button with accessibilityInput- Form input with validation statesSearchInput- Input with integrated search iconSelect- Dropdown select componentTextarea- Multi-line text inputToggle- Switch/toggle for boolean values
Layout & Structure:
Card- Container component with styling variantsFieldSet- Form field spacing containerFlex- Flexbox layout with alignment and spacingTable- Semantic table components
Form Support:
FormLabel- Label with required indicatorLabel- Semantic form labelsErrorMessage- Validation error displayHelpText- Helper text for formsReadOnlyField- Display label with read-only valueCheckIcon- Success indicator icon
Feedback & Status:
Badge- Status and label badgesInfoBox- Informational messages with variantsSeverityBadge- Severity level indicators (1-4)Spinner- Loading indicatorsStatusBadge- Status indicators with color mapping
Form Components:
FormInput- Self-managed input with FormContext integrationFormSelect- Self-managed select with FormContext integrationFormTextarea- Self-managed textarea with FormContext integrationFormCheckbox- Self-managed checkbox with FormContext integrationFormFileUpload- File upload with preview and validationFormFieldWrapper- Reusable field layout wrapper
Deprecated (Legacy Support):
FormInputGroup-β οΈ Use FormInput + FormContext insteadFormSelectGroup-β οΈ Use FormSelect + FormContext insteadFormTextareaGroup-β οΈ Use FormTextarea + FormContext instead
UI Patterns:
ModalShell- Accessible modal dialog
DatePicker- Comprehensive date selection with range support, keyboard navigation, and custom formatsTimePicker- Standalone time selection component
Form System:
FormProvider- Context-based form state managementuseFormContext- Hook to access form state- Validation engine with built-in rules
- Type-safe field definitions
Positioning & Layout:
useDrawerPosition- Smart drawer/popover positioning with viewport awareness- Auto-positions to avoid overflow
- Mobile-first modal centering
- Desktop smart placement (above/below)
- Handles resize and scroll events
- Fully customizable breakpoints
See Hooks Documentation for detailed usage examples.
- Button variants (primary, secondary, success, danger, etc.)
- Card variants (default, elevated, outlined, interactive)
- Input variants (default, error, success, disabled)
- Size utilities (xs, sm, md, lg, xl)
- Typography variants
- Color schemes
Atomos UI uses Tailwind CSS. Add the library to your Tailwind content paths:
// tailwind.config.js
module.exports = {
content: ['./src/**/*.{js,ts,jsx,tsx}', './node_modules/@atomos/ui/dist/**/*.{js,mjs}'],
// ... rest of config
}Explore the components interactively:
cd packages/atomos
pnpm storybookVisit Atomos UI Storybook for live documentation.
This library is maintained within the Kompartido monorepo and synced to the standalone atomos.dev repository.
pnpm buildpnpm devpnpm type-checkContributions are welcome! Please read our contributing guidelines.
MIT Β© binaryjack
Built with β€οΈ by binaryjack