Skip to content

Code Library

@my-lab/ui is the shared React UI package. It exports component primitives, token objects, and shared CSS.

import { Button, Input, designTokens } from "@my-lab/ui";
import "@my-lab/ui/styles/global.css";
PathResponsibility
src/componentsReact UI components
src/hooksComponent support hooks such as mobile detection
src/tokensDesign token objects
src/styles/global.cssCSS variables, Tailwind source config, global reset
src/typesLocal module declarations for package interop
src/vendorSmall compatibility wrappers for bundler/runtime interop
src/lib/utils.tsShared class name helper

Do not add a new component only because one screen needs local markup. Add a design-system component when at least two screens need the same behavior or when accessibility/state logic is easy to get wrong.

The shadcn component catalog is implemented as real reusable components, not Storybook-only markup.

  • Public exports live in packages/ui/src/index.ts.
  • Component implementation files live in packages/ui/src/components.
  • Storybook catalog examples live in packages/ui/src/shadcn-showcase.
  • The Storybook path is Design System/shadcn/Components.

Complex examples should show production-shaped composition. For example, Sidebar should show an application shell, Navigation Menu should show 2-depth navigation, Menubar should show multiple menu types, and Field should show grouped accessible form sections.

When a dependency has Vite or ESM/CJS interop issues, keep the workaround isolated.

  • Prefer a package-level wrapper in src/vendor.
  • Keep Storybook-only aliasing in apps/storybook/vite.config.ts.
  • Do not spread compatibility code into component call sites.