Skip to main content

Designing a Design System with the shadcn/ui Button

About this guide

This guide targets React 19 / Tailwind CSS v4 / the latest shadcn/ui. Using the shadcn/ui Button as the subject, you learn how to design reusable components aligned with a design system through design tokens, cva, the cn function, and Radix Slot, across 13 chapters.

By the time you finish this guide, you will be able to do the following.

Design reusable components yourself, following design system best practices (design tokens, declarative variants, safe customization, composition, type safety).

Who this guide is for

  • You understand the basics of React (components, props, state)
  • You have used basic Tailwind CSS classes
  • You want to read and understand shadcn/ui code

Structure of the guide

The learning path

The guide is organized into four parts, progressing in order from the foundations to practice.

PartThemeChaptersWhat you learn
FundamentalsIntroduction and foundations4Introduction / environment setup / the finished Button / Tailwind basics
Design SystemManaging color by meaning1Designing design tokens (OKLCH)
Core TechniquesThe techniques behind the Button5cva / cn / ref forwarding / Radix Slot / TypeScript integration
PracticeApply it hands-on3Build from scratch / apply to other components / toward a design system

Chapters

Fundamentals

Design System

Core Techniques

Practice

Now, let's start with the Introduction.