@phroche/p-ds
v0.2.1
Published
CSS-variable-driven design system CLI — add components, themes, and tokens to your project.
Maintainers
Readme
@phroche/p-ds
The CLI for the Phronetic design system. Scaffolds Next.js projects with the DS 1.0 theme pre-wired, then lets you add components and sections from a registry of 1,100+ entries.
Components are copied into your project as source files — you own them. The CLI is only needed when scaffolding or adding new components.
Quick start
# Scaffold a new project (DS 1.0 theme by default)
npx @phroche/p-ds init
# Add components
npx @phroche/p-ds add button card dialog
# Add pre-built marketing sections
npx @phroche/p-ds add --sections hero-1 pricing-3 footer-2Or install globally for shorter commands:
npm install -g @phroche/p-ds
p-ds init
p-ds add buttonWhat init does
Running p-ds init in an empty directory (or an existing Next.js project):
- Creates a Next.js 16 + Tailwind v4 project if one doesn't exist
- Installs
p-ds-tokensas a project dependency (the DS 1.0 CSS variables) - Writes
src/app/globals.csswith@import "p-ds-tokens/css"so token variables are available everywhere - Scaffolds
src/assets/icons/with a Lucide provider and 18 brand SVGs - Writes
p-ds.config.jsonat the project root - Installs all required dependencies (
@base-ui/react,tailwindcss,class-variance-authority,tailwind-merge,clsx,lucide-react,next-themes)
Themes
DS 1.0 is the default. Pass --theme to choose another:
p-ds init --theme ds1.0 # Phronetic brand (default)
p-ds init --theme phronetic # Phronetic legacy palette
p-ds init --theme default # Clean, minimal (zinc)
p-ds init --theme indigo # Soft, rounded (violet)
p-ds init --theme brutalist # Bold, hard shadows (hot pink)Skip all prompts with -y:
npx @phroche/p-ds init --theme ds1.0 -yCommands
p-ds add
Copies components into src/components/ui/. Resolves transitive dependencies automatically — adding data-table also installs table, button, input, badge, etc.
p-ds add button
p-ds add button card dialog input label field # multiple at once
p-ds add -y button card # skip confirmation
p-ds add --sections hero-1 pricing-3 footer-2 # marketing sectionsp-ds list
p-ds list # all UI components + install status
p-ds list --sections # all sections grouped by category
p-ds list --installed # only installed componentsp-ds diff
Shows what changed in the registry since you installed a component.
p-ds diff
p-ds diff buttonp-ds update
Pulls upstream changes into installed components.
p-ds update # all installed components
p-ds update button # specific componentp-ds transform
Rewrites hardcoded Tailwind color utilities to CSS variable equivalents.
p-ds transform src/components/ui/button.tsxConfiguration
p-ds init creates p-ds.config.json in your project root:
{
"theme": "ds1.0",
"aliases": {
"components": "@/components/ui",
"utils": "@/lib/utils"
},
"css": "src/app/globals.css"
}| Field | Description |
|-------|-------------|
| theme | Active theme name |
| aliases.components | Where components are written |
| aliases.utils | Where cn() utility lives |
| css | Path to your global CSS file |
How tokens work
p-ds init installs p-ds-tokens as a dependency of your project and adds this to globals.css:
@import "p-ds-tokens/css";This makes all DS 1.0 CSS custom properties (--color-primary, --color-background, --button-bg, etc.) available to Tailwind and your components.
When the design system updates token values (colors, spacing, radius), you pick up the changes with:
npm update p-ds-tokensNo need to re-run p-ds add or touch component files. See p-ds-tokens for details.
Component API conventions
- render prop — polymorphic components use
render={<Element />}, notasChild - Icons — always
import { X } from "@/assets/icons", never fromlucide-reactdirectly - Brand icons —
import { Github } from "@/assets/icons/brand" - cn() —
import { cn } from "@/lib/utils"for conditional class merging - Motion —
import { motion } from "motion/react"(notframer-motion) - Dark mode — toggled via
.darkclass on<html>, supported by all components out of the box
Available components (107)
Form: button, input, textarea, label, field, input-group, checkbox, radio-group, switch, select, combobox, multi-select, slider, number-input, rating, tag-input, file-upload, rich-text-editor, color-picker, date-range-picker, time-picker, input-otp
Overlay: dialog, sheet, alert-dialog, drawer, popover, tooltip, hover-card, context-menu, dropdown-menu, menubar, command, tour
Navigation: navigation-menu, breadcrumb, pagination, tabs, sidebar, app-shell
Display: card, badge, alert, avatar, separator, skeleton, progress, spinner, accordion, collapsible, scroll-area, resizable, aspect-ratio, toggle, toggle-group, segmented-control, description-list, empty, watermark
Data: data-table, chart, area-chart, bar-chart, line-chart, donut-chart, spark-chart, bar-list, tracker, stat-card, calendar
Media: carousel, image-zoom, video-player, video-grid, video-tile, audio-visualizer, qr-code
Communication: chat, chat-input, chat-message, message-bubble, notification-center, typing-indicator, sonner
Misc: kanban-board, transfer-list, tree-view, stepper, timeline, code-block, kbd, inline-cta, suggestion-chips
Sections
Sections are named {category}-{number} (e.g. hero-1, pricing-3). Use p-ds list --sections to see all 978.
p-ds add --sections hero-1 feature-5 pricing-2 footer-1Import and render them directly:
import Hero1 from "@/components/sections/hero/hero-1"
import Pricing2 from "@/components/sections/pricing/pricing-2"
export default function Page() {
return (
<>
<Hero1 />
<Pricing2 />
</>
)
}Updating the CLI / publishing
cd packages/novacn
npm run build # rebuilds registry (1,146 entries) + CLI bundle
npm version patch
npm publish --access public