All packages/@batoanng/mui-components
Components

@batoanng/mui-components

Typed MUI primitives, atomic UI building blocks, and a shared theme system for product teams.

Version 3.7.02 min read13 peer deps3 entrypoints2 exports

Quick install

npm install @batoanng/mui-components

Wrap 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 ThemeProvider and CssBaseline
  • 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

  • .storybook
  • eslint.config.mjs
  • nodemon.json
  • package.json
  • prettier.config.cjs
  • src/
  • 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/react
  • framer-motion
  • react
  • react-dom
  • react-dropzone
  • react-hook-form
  • react-idle-timer
  • @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.

npm version install size Storybook

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 ThemeProvider and CssBaseline
  • 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.