This file ships with the package (files includes RULES.md). Every
consumer — alexandria-web-application, alexandria-design, and any future
app — must follow these rules.
Forbidden:
- Hand-rolled
<button>/<input>whenButton/Inputexists in@code-sherpas/pharos-react. - Importing primitives (
@radix-ui/*,@base-ui/*,antd,@heroicons/*,@headlessui/*) directly. Pharos wraps what it needs. - Copy-pasting a Pharos component into the consumer and modifying it. If Pharos is missing a variant, open an issue in this repo.
Pharos names follow shadcn/ui > Base UI > ARIA APG (tiebreaker: shorter name). If you are migrating Alexandria, translate the old name to the Pharos canonical one — do not alias.
| Alexandria-ish | Pharos canonical |
|---|---|
PrimaryButton / CtaBtn |
<Button variant="…" /> |
Modal / Popup |
Dialog |
Drawer / SidePanel |
Sheet |
Toast / Notification |
Toast |
Chip / Pill / Tag |
Badge |
(Full list lives in NAMING-decisions.md once Phase 2 starts.)
// in your app's root entry file
import '@code-sherpas/pharos-react/styles.css';This loads the compiled CSS Modules output of every component (hashed class names that the React components reference at runtime). Without it, components render unstyled.
You do not need Tailwind, PostCSS, or any other CSS framework to consume
pharos-react (Decision D9). The published bundle is pure CSS — no
@layer directives, no preflight, no global resets, no class-name
collisions with your own utilities. It works the same in Next.js + Tailwind
v3, Next.js + Tailwind v4, Vite + plain CSS, Astro, Remix, or any other
React stack.
Consumers must install it explicitly. It is not transitively bundled to avoid duplicate CSS var declarations:
pnpm add @code-sherpas/pharos-react @code-sherpas/pharos-tokensVersion compatibility is declared via peerDependencies in
pharos-react/package.json. Upgrade both together.
Pharos components expose their full variant axis (size, tone, intent, etc.) via props. Forbidden:
- Overriding internal class names to "fake" a variant that does not exist.
- Passing
classNamestrings that conflict with the component's theme (e.g.className="bg-red-500"on a<Button>to make it red — useintent="destructive"or open an issue).
className is allowed for layout tweaks (margins, widths), not visual
identity.
- Breaking change in this repo → major bump → consumers upgrade explicitly.
- New component or variant → minor bump → consumers may adopt freely.
- Bugfix, visual tweak, or internal refactor → patch → consumers get it for free.
Every PR that affects the public API includes a changeset. If your PR does not, CI will fail.
Pharos uses Lucide (decision D4). When a component needs an icon you do
not pass, Pharos renders the Lucide default. If you need a custom icon,
open a PR to add it under src/icons/ — do not ship icons from the
consumer that duplicate Lucide.
Do not publish @yourorg/pharos-react-extended. If a product needs its own
components, build them in the consumer under your own naming namespace and
document it. If the need is general, propose it in this repo.