@pcoi/components
v2.0.0
Published
PCOI Design System — React UI component library.
Readme
@pcoi/components
React component library for the PCOI Design System — 67 components (buttons, forms, chat, tables, navigation, overlays, data display) implemented against the audited PCOI Figma file. Dark-first, themed entirely through @pcoi/tokens custom properties.
Install
npm install @pcoi/components @pcoi/tokens @pcoi/iconsInstall all three packages explicitly (strict package managers like pnpm block transitive imports — and the quick-start below imports from @pcoi/icons). React and React DOM >=18 are peer dependencies; TypeScript consumers need @types/react 18.3 or later (the published type definitions reference the JSX export added in 18.3).
Setup
Two imports at your application entry are required:
import "@pcoi/tokens"; // custom properties + fonts + type classes
import "@pcoi/components/styles.css"; // the component stylesComponent JS does not self-import token CSS — without @pcoi/tokens loaded, components render unstyled grey boxes. Optionally add PCOI's global resets:
import "@pcoi/tokens/global.css";Then set the theme attribute (PCOI is dark-first):
<html data-theme="dark">Usage
import { Button, Badge, Modal } from "@pcoi/components";
import { IconCheck } from "@pcoi/icons";
<Button style="primary" label="Ship it" startIcon={<IconCheck />} />Every component's props, variants, and accessibility contract are documented in the PCOI Storybook.
Notes
- The stylesheet's class names are hashed (
pcoi-*) and are not API — target components via your own wrappers ordata-*attributes, not internal class names. - ESM-only. Works with any modern bundler (Vite, Next.js 14+, webpack 5).
License
MIT
