spartan
Website • Documentation • Components • Blocks • GitHub
Cutting-edge tools that power Angular full-stack development - accessible, un-styled UI primitives with copy-paste, shadcn-style styles, plus an opinionated full-stack setup. Build like a spartan.
Welcome to the spartan mono-repo. This Nx repository is home to spartan/ui - accessible, un-styled UI primitives for Angular with copy-paste, shadcn-style helm styles - and the spartan/stack, an opinionated full-stack setup built on AnalogJs.
spartan/ui is 1.0 and stable: production-ready, semantically versioned, and
shipping more than 55 components. Install it from npm with
@spartan-ng/brain and the
@spartan-ng/cli, or explore everything at
spartan.ng.
Packages
| Package | Description | |
|---|---|---|
@spartan-ng/brain |
Headless, accessible UI primitives for Angular - the behavior half of spartan. | npm |
@spartan-ng/cli |
Nx plugin & Angular schematics that add spartan/ui to any workspace in one go. | npm |
@spartan-ng/mcp |
Model Context Protocol server giving AI assistants up-to-date spartan docs. | npm |
The styled helm components aren't published as a package on purpose - the CLI copies them straight into your project so you own and customize every line.
The 300 spartans
All of spartan is an MIT-licensed open source project with its ongoing development made possible by contributors and sponsors.
Our initial 300 contributors and sponsors are featured here and on the front page of spartan.ng
- goetzrobin
- thatsamsonkid
- elite-benni
- ashley-hunter
- marcjulian
- MerlinMoos
- zeropsio
- snyder-tech
- mihajm
- ajitzero
- arturgawlik
- deepakrudrapaul
- evanfuture
- AdditionAddict
- Altamimi-Dev
- ferat
- jeremy-js-devweb
- heddendorp
- tutkli
- Pascalmh
- okkindel
- oidre
- nartc
- santoshyadavdev
- markostanimirovic
- theo-matzavinos
- jkuri
- dongphuong0905
- DominikPieper
- brandonroberts
- izikd
- ryancraigmartin
- gaetanBloch
- gergobergo
- rpacheco124
- benjaminforras
- jstnjs
- r3ps4J
- Celtian
- miljan-code
- alexciesielski
- ty-ler
- m-risto
- badsgahhl
- monacodelisa
- tomdev9
- ragul1697
- kkamman
- i-am-the-slime
- DevWedeloper
- mrsofiane
- mateoetchepare
- DonaldMurillo
- toniskobic
- eneajaho
- Den-dp
- 0xfraso
- Muneersahel
- danilolmc
- tomalaforge
- canserkanuren
- cjosue15
- hirenchauhan2
- Roguyt
- tsironis13
- guillermoecharri
- ValentinFunk
- Femi236
- dineshkp
- robingenz
- Balastrong
- OlegSuncrown
- stewones
- shinkhouse
- donaldxdonald
- BenoitPE
- Georg632
- hillin
- Besbash
- davidedammino
- marcindz88
- thyco
- hitro11
- GODrums
- samsonkumawong
- PR4SAN
- JeevanMahesha
- dlhck
- tomer953
- drdreo
- tlandenberger
- yackinn
- OmerGronich
- kubalinio
- AlexHladin
- CO97
- MatanShushan
- maxhov
- josueggh
- namdien177
- zelenchuk
- a-malacarne
- YasinKuralay
- nico13051995
- francotalarico
- koenigderluegner
- Turtl3e
- minhnguyen120898
- liam-langstaff
- dw-0
- Khumozin
- abiramcodes
- garygrossgarten
- Oussemasahbeni
- benpsnyder
- dhwani1806
- elite-lucas
- esteecodes
- felhag
- notsufferbutbutter
- vlrjuan
- Dafnik
- hassantayyab
- mathwizard
- RaminGe
- abos-gergo
- jpsullivan
- ayangabryl
- s-froghyar
- aziz-zina
- avihayAsus
- multignite
- sefatanam
- LinboLen
- Oneill19
- homj
- Musta-Pollo
- mitja-kurath
- alisterpineda
- amitshalev2
- SOG-web
- Joebeurg
- mehrabix
- PatrickLarocque
- Ban117
- gerasidev
- Nicoss54
Sponsor spartan
spartan is MIT-licensed and free, forever. But free to use isn't free to build - countless hours of late-night, hard-fought work hold this phalanx together, and they keep the components shipping and the docs current.
If spartan saves your company or team time, consider returning the favor. Sponsoring keeps spartan actively maintained, the roadmap moving, and the open-source work of the 300 sustainable. No spartan holds the line alone - every shield in the wall counts.
Zerops: The Strategic Alliance
spartan.ng has formed a powerful alliance with Zerops, a developer-first cloud platform that shares our commitment to advancing the Angular ecosystem.
Through their strategic support, Zerops has enabled:
- Dedicated resources for our core development team
- Accelerated component development on our path to v1 and beyond
- Creation of production-ready templates and starter kits
- Long-term sustainability for the entire project
Zerops eliminates deployment complexity so developers can focus on building great software—a philosophy that perfectly aligns with our mission to create powerful yet easy-to-implement components.
Experience the cloud platform that's powering Spartan.ng's future →
spartan/ui
spartan/ui brings the shadcn/ui philosophy to Angular: accessible, un-styled primitives - inspired by Radix and built on the Angular CDK and other proven community solutions - paired with beautiful, copy-paste shadcn-style styles that you own.
Each primitive is made up of two halves:
- a headless
brainlibrary inlibs/brainthat provides the behavior, accessibility, and state - published to npm as@spartan-ng/brain. - a
helmlibrary inlibs/helmthat adds the styles, copied straight into your project by the CLI so you can edit them freely.
libs/cli holds the Nx plugin & Angular CLI code that adds spartan/ui to any Nx or Angular workspace in a single command - published as @spartan-ng/cli.
libs/mcp is a Model Context Protocol server - published as @spartan-ng/mcp - that gives AI assistants up-to-date spartan docs, components, and blocks.
The skills/spartan folder contains the spartan agent skill - procedural knowledge that teaches AI coding assistants how to build spartan/ui correctly. Users install it with npx skills add spartan-ng/spartan. See the Skills docs.
Install Dependencies
Run pnpm install to install the dependencies of this project.
Development with storybook
A storybook project is set up and is the primary way to develop UI components. You can run it with:
pnpm run storybook
Story files live in apps/ui-storybook/stories, one per primitive, e.g. apps/ui-storybook/stories/accordion.stories.ts.
Use these files to add stories and drive development of the primitives.
Testing
spartan uses Jest for tests. To test all projects locally, run the following command from the root folder:
pnpm run teste2e testing
Cypress e2e testing is set up to run on the storybook. You can run it with:
pnpm run e2e
To add your own e2e tests add them to the apps/ui-storybook-e2e application.
spartan/stack
An example application running on Supabase, Drizzle, Analog, tRPC, Tailwind, Angular, and Nx. It also serves as the documentation page introducing the stack and UI library.
Follow the directions in the official documentation to set up your own project: https://www.spartan.ng/stack/overview
Example App
In the apps folder of this repository, you can also find an example application of the spartan stack.
It also serves as the documentation page for this project.
Follow the directions below to get it up and running:
Prerequisites
- You will need
pnpmas your package manager. - You will need to set up a Supabase account (it's free)
- You will need NodeJs installed. The version I have working is
20.17.0.
Development server
Then you can run the following command:
pnpm nx serve appor
pnpm run devfor a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Database
We use Drizzle to connect to a Supabase instance for the example app.
Add an .env file to your repo with the following contents:
Add a .env file at the root of your Nx workspace and add the connection string like so:
DATABASE_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-SUPABASE-REFERENCE-ID].supabase.co:5432/postgres?schema=public"
And make sure to run the following script in your Supabase editor to set up the necessary tables:
create table
public.note (
id bigserial,
title text not null,
content text null,
created_at timestamp with time zone null default current_timestamp,
constraint notes_pkey primary key (id)
) tablespace pg_default;[!NOTE] >
.envshould be added to.gitignore
Understand this workspace
Run pnpm nx graph to see a diagram of the dependencies of the projects.
Documentation
Community
Run into an issue or have a question? Open an issue on GitHub or say hi in Discord.
License
MIT © goetzrobin and the spartan contributors