@upbound/monarch-core
v0.9.1
Published
Upbound's design system — primitive components.
Downloads
2,274
Keywords
Readme
@upbound/monarch-core
Upbound's design system — primitive components. Radix UI/Base UI-backed building blocks (Button, Dialog, Select,
Sidebar, and 60+ more) with Monarch's tokens and theming baked in.
Deliberately dependency-light: no charting, no table state, nothing beyond what a primitive component genuinely needs.
For composed, heavier components (charts, data tables, filter bars), see
@upbound/monarch-blocks.
Install
npm install @upbound/monarch-corePeer dependencies: react and react-dom (^18.3.0 || ^19.0.0), tailwindcss (^4.0.0).
Set up the theme
Two additions to your Tailwind entry CSS — both required:
@import 'tailwindcss';
@import '@upbound/monarch-core/theme.css';
@source '../../node_modules/@upbound/monarch-core/dist/*.js';(Path assumes a Next.js --src-dir layout, where your Tailwind entry CSS lives at src/app/globals.css — two
directories above your project root, where node_modules sits. Adjust to match wherever your own entry CSS actually
lives.)
@import "@upbound/monarch-core/theme.css"pulls in Monarch's design tokens, dark-mode values, and the base-layer rules a handful of components rely on for correct rendering (e.g.ButtonGroup's border-merging).@sourcetells Tailwind v4's JIT scanner to look inside this package's compiled files for the utility classnames used in componentclassNames (bg-primary,text-h1, etc.). Without it, Tailwind never generates CSS for those classes — they only exist insidenode_modules, outside Tailwind's default scan root. Usedist/*.js(not a recursivedist/**/*.jsor**/*.js) — a recursive glob silently matches nothing under Next.js's Turbopack Tailwind integration; a single-level glob works and is sufficient since every compiled file sits directly indist/, with no subdirectories.
Fonts
theme.css references --font-inter and --font-outfit but doesn't ship font files — by default both fall back to a
system-font stack, so components render correctly with zero setup. To get Monarch's exact Inter/Outfit branding, load
those fonts yourself (next/font, a Google Fonts <link>, self-hosted @font-face) and set the two CSS variables on
:root or <html>; your setup will win over the built-in fallback automatically.
Dark mode
Add a .dark class anywhere up the tree (<html>, <body>, or a scoped wrapper) to switch themes — no separate
dark-mode setup needed. Pair with next-themes or your own toggle.
Use a component
import { Button } from '@upbound/monarch-core';
export function Example() {
return <Button>Click me</Button>;
}Or import a single component's own subpath — guarantees per-file tree-shaking regardless of your bundler:
import { Button } from '@upbound/monarch-core/button';Server Components
The root barrel (@upbound/monarch-core) bundles all 67 components into one file and is a client boundary
unconditionally — some components need client-side React, and a single file can't be client for some exports and not
others. If you need a guaranteed-server-safe component in a Server Component tree, import its own subpath instead of the
barrel:
// Always safe in a Server Component — no client boundary crossed.
import { Skeleton } from '@upbound/monarch-core/skeleton';Also available via shadcn
Prefer to own the source in your own repo instead of installing a package? Every component here is also available
through the shadcn CLI, once your project's components.json points its registries at Monarch's registry — see the
main docs site for the full setup. Both channels ship the same components; pick whichever fits your project.
