Twitter0

CLI

Add accessible UI primitives to any Angular project with one command.

The spartan CLI is the fastest way to add components to your project. It works with both Angular CLI projects and Nx workspaces - no additional configuration required.

For each component you add, the CLI automatically installs the Brain primitive from npm and copies the Helm styles into your codebase. You choose individual components or install them all at once.

Installation

Install the spartan CLI as a dev dependency:

pnpm add -D @spartan-ng/cli

Setup Your Theme

Before adding components, configure your theme and Tailwind settings:

ng g @spartan-ng/cli:ui-theme

The CLI will prompt you to select your application, locate your styles entry point, choose a theme, and set your preferred border radius. This only needs to be done once.

Add Components

Add spartan/ui components to your project:

ng g @spartan-ng/cli:ui

You'll be prompted to select components to add - choose individual components or all of them. The CLI takes care of the rest.

What the CLI Does

When you add a component, the CLI automatically:

  • Installs the Brain primitives: Adds the @spartan-ng/brain package to your package.json if needed
  • Copies Helm files: Places styled component code into your project at your specified location
  • Configures imports: Updates your project configuration to recognize the new components
  • Creates libraries (Nx only): Optionally generates buildable libraries for better code organization

Result: Brain primitives are installed as maintained npm dependencies. Helm styles live in your codebase where you can edit them freely. No manual setup required.

Recommended Workflow

  1. Install tailwindcss: official Angular installation guide
  2. Install the CLI: npm i -D @spartan-ng/cli
  3. Set up your theme: ng g @spartan-ng/cli:ui-theme
  4. Add components as needed: ng g @spartan-ng/cli:ui
  5. Customize the copied Helm files to match your design system
  6. Ship your app with complete control over every style
components.json Introduction