@henrylatour/lib

My React 19 component library, shared by all of my apps: about 40 component families on Base UI primitives with Tailwind v4 design tokens, light and dark themes, and a chart set for analytics dashboards.

Nov 2026 – Present

  • React 19
  • TypeScript
  • Base UI
  • Tailwind v4
  • CVA
  • ECharts
  • Ladle
  • pnpm + Turborepo
  • Biome
  • GitHub Actions
  • GitHub Packages
  • GitHub Pages

Overview

@henrylatour/lib is the shared UI layer behind all of my apps: Claude UI, analytics, jobs, auth and this site. It's a React 19 kit built on Base UI's accessible primitives and styled with Tailwind v4 design tokens. Inside the monorepo, apps use it as TypeScript source. Releases go to GitHub Packages.

What's in it

  • Forms: inputs, textarea, select, autocomplete (single or multi select, with optional create), checkbox (including indeterminate), radio, switch, a key-value editor, and filter chips.
  • Overlays: dialogs and sheets, popovers, menus (including checkbox items), tooltips, and toasts with actions.
  • Layout and feedback: cards, tabs, collapsibles, scroll areas, badges, avatars, meters, skeletons, spinners and empty states.
  • Data and charts: time series charts (line, area or bar, with dashed comparison periods), a funnel, a retention grid, a Sankey diagram, bar lists, a legend, stat tiles, a compact data table with a sticky header and footer, a code block, and a date range picker.

Technical notes

  • Theming: semantic tokens (bg-surface, text-muted, border-border…) are CSS variables that a .dark class swaps. Charts use 8 categorical slots (--viz-1…8). The ECharts canvas charts read these colors at runtime and re-render when the theme class changes.
  • Mobile: dialogs have a responsive mode that is full-screen on phones and centered from sm up. Bottom and side sheets close with a swipe and expand with a drag. Fields use 16px text on phones so iOS doesn't zoom.
  • Stat tiles fit their value: a tile tries the full number first, then a compact form, then a smaller size, and only then truncates with an ellipsis. It re-fits when the tile is resized.
  • Structure: one component per file and a single public index.ts, so the public API is explicit and renaming an export counts as a breaking change. Every family has Ladle stories.
  • Tree shaking: the build ships one ES module per component, and the package is marked as side-effect free. An app's production bundle only includes the components it imports, along with their dependencies. Heavier pieces, like the charts, stay out of apps that don't use them.
  • Release: GitHub Actions publishes when packages/ui has a version that isn't on the registry yet. It then tags lib-v<version> and deploys the stories as a public docs site.