@batoanng/mui-components
Typed MUI primitives, atomic UI building blocks, and a shared theme system for product teams.
Quick install
npm install @batoanng/mui-componentsWrap your app with the shared theme
The package exports both theme primitives and ready-to-use components for immediate adoption.
Context
What It Covers
Ship consistent interfaces faster with a shared component library, bundled theme tokens, test utilities, and form-ready building blocks.
- Built on MUI 9
- Organized by Atomic Design (Atoms, Molecules, Forms)
- Theming support (Light/Dark mode, tokenized palette, typography)
- Custom hooks and utilities
⨠Features
- Built on MUI 9
- Organized by Atomic Design (Atoms, Molecules, Forms)
- Theming support (Light/Dark mode, tokenized palette, typography)
- Custom hooks and utilities
- Ready-to-use with
ThemeProviderandCssBaseline - Developer tooling: Storybook, Vitest, ESLint, Prettier
- Published on npm and deployed Storybook: mui-components-batoanng.vercel.app
Setup
Installation
Bring the package into your project with the published npm entrypoint.
npm install @batoanng/mui-components
š¦ Installation
npm install @batoanng/mui-components
You must also install peer dependencies if not already present:
npm install react react-dom @mui/material @mui/icons-material @mui/utils @emotion/react @emotion/styled framer-motion react-hook-form
Some exports need optional peer dependencies:
npm install @mui/x-date-pickers react-dropzone react-idle-timer
Start
Wrap your app with the shared theme
The package exports both theme primitives and ready-to-use components for immediate adoption.
import { CssBaseline, ThemeProvider } from '@mui/material';
import { Button, defaultTheme } from '@batoanng/mui-components';
export function App() {
return (
<ThemeProvider theme={defaultTheme}>
<CssBaseline />
<Button variant="contained">Launch</Button>
</ThemeProvider>
);
}
š Quick Start
Wrap your application with the theme provider:
import { defaultTheme } from '@batoanng/mui-components';
import { CssBaseline, ThemeProvider } from '@mui/material';
export default function App() {
return (
<ThemeProvider theme={defaultTheme}>
<CssBaseline />
{/* Your app components */}
</ThemeProvider>
);
}
Use components:
import { Button } from '@batoanng/mui-components';
<Button variant="contained">Click me</Button>;
Surface
Exports And Entrypoints
Export surface
.-> types:./dist/src/index.d.ts, import:./dist/components.js, default:./dist/components.js./test-utils-> types:./dist/src/test-utils.d.ts, import:./dist/test-utils.js, default:./dist/test-utils.js
Entrypoints
- main:
./dist/components.js - module:
./dist/components.js - types:
./dist/src/index.d.ts
Key files
.storybookeslint.config.mjsnodemon.jsonpackage.jsonprettier.config.cjssrc/tsconfig.build.json
Integration
Integration Notes
Peer dependencies
@emotion/react@emotion/styled@mui/icons-material@mui/material@mui/utils@mui/x-date-pickers@testing-library/reactframer-motionreactreact-domreact-dropzonereact-hook-formreact-idle-timer
Internal workspace links
@batoanng/utils@batoanng/eslint-config@batoanng/prettier-config@batoanng/tsconfig@batoanng/vite-config
Ops
Development Notes
Latest release snapshot
3.7.0
Minor Changes
- Refine button hover states so contained, outlined, and text variants keep readable colors and use subtle theme-aware state changes.
- Fix outlined input focus styling so the field background no longer covers the visible border.
- Move test utilities from the root bundle to
@batoanng/mui-components/test-utils. - Reduce package output by dropping the UMD build and externalizing runtime dependencies from the library bundle.
- Update package metadata, peer dependency docs, and package-size guardrails.
š§© Components Structure
src/
āāā components/
ā āāā atoms/ # Base building blocks (e.g., Button, Label)
ā āāā molecules/ # Compound components (e.g., IdleTimer)
ā āāā form/ # Input controls and validation-aware forms (integrated with react-hook-form)
ā āāā index.ts # Entry point for all component exports
All components are re-exported via @batoanng/mui-components:
import { FormTextField } from '@batoanng/mui-components';
Test utilities are exported from a separate subpath so production bundles do not include Testing Library:
import { render, screen } from '@batoanng/mui-components/test-utils';
š§° Development
Common commands:
pnpm dev # Start Storybook
pnpm test # Run unit tests with Vitest
pnpm lint # Run ESLint
pnpm format # Format with Prettier
pnpm build # Build library output
pnpm clean # Remove local build, Storybook, cache, and package install artifacts
Linting is configured through the local flat config entrypoint at eslint.config.mjs, which composes:
@batoanng/eslint-config@batoanng/eslint-config/typed@batoanng/eslint-config/test
š Storybook
View the full component library online:
š https://mui-components-batoanng.vercel.app/
To run locally:
pnpm dev
Source docs
Reference
The full README is rendered below so the package guide stays detailed and traceable to the source docs that live with the package itself.
A fully typed, themeable, and accessible component library built with React, TypeScript, and Material UI (MUI). It follows atomic design principles and ships with a complete theming system, hooks, test utilities, and form support to accelerate UI development across multiple projects.
⨠Features
- Built on MUI 9
- Organized by Atomic Design (Atoms, Molecules, Forms)
- Theming support (Light/Dark mode, tokenized palette, typography)
- Custom hooks and utilities
- Ready-to-use with
ThemeProviderandCssBaseline - Developer tooling: Storybook, Vitest, ESLint, Prettier
- Published on npm and deployed Storybook: mui-components-batoanng.vercel.app
š¦ Installation
npm install @batoanng/mui-components
You must also install peer dependencies if not already present:
npm install react react-dom @mui/material @mui/icons-material @mui/utils @emotion/react @emotion/styled framer-motion react-hook-form
Some exports need optional peer dependencies:
npm install @mui/x-date-pickers react-dropzone react-idle-timer
š Quick Start
Wrap your application with the theme provider:
import { defaultTheme } from '@batoanng/mui-components';
import { CssBaseline, ThemeProvider } from '@mui/material';
export default function App() {
return (
<ThemeProvider theme={defaultTheme}>
<CssBaseline />
{/* Your app components */}
</ThemeProvider>
);
}
Use components:
import { Button } from '@batoanng/mui-components';
<Button variant="contained">Click me</Button>;
š§© Components Structure
src/
āāā components/
ā āāā atoms/ # Base building blocks (e.g., Button, Label)
ā āāā molecules/ # Compound components (e.g., IdleTimer)
ā āāā form/ # Input controls and validation-aware forms (integrated with react-hook-form)
ā āāā index.ts # Entry point for all component exports
All components are re-exported via @batoanng/mui-components:
import { FormTextField } from '@batoanng/mui-components';
Test utilities are exported from a separate subpath so production bundles do not include Testing Library:
import { render, screen } from '@batoanng/mui-components/test-utils';
šØ Theming System
Located in src/theme/, it includes:
- Light and Dark theme create function
- Custom spacing, radii, shadows, typography
- Color palette consistent with brand/UI tokens
Usage:
import { defaultTheme, createDefaultTheme } from '@batoanng/mui-components';
const lightTheme = createDefaultTheme({}); // Light theme is default
const darkTheme = createDefaultTheme({ darkTheme: true });
<ThemeProvider theme={lightTheme}>...</ThemeProvider>
<ThemeProvider theme={darkTheme}>...</ThemeProvider>
š§° Development
Common commands:
pnpm dev # Start Storybook
pnpm test # Run unit tests with Vitest
pnpm lint # Run ESLint
pnpm format # Format with Prettier
pnpm build # Build library output
pnpm clean # Remove local build, Storybook, cache, and package install artifacts
Linting is configured through the local flat config entrypoint at eslint.config.mjs, which composes:
@batoanng/eslint-config@batoanng/eslint-config/typed@batoanng/eslint-config/test
š Storybook
View the full component library online:
š https://mui-components-batoanng.vercel.app/
To run locally:
pnpm dev
Package Size
The published package is checked with npm pack --dry-run. Local folder size can be much larger because ignored generated folders such as node_modules/.cache and storybook-static are created during development.