Skip to main content

47 docs tagged with "react"

View all tags

About this book

This book is an introduction to learning modern React development systematically from the ground up. From JavaScript basics to advanced React topics, you can build practical skills step by step.

Advanced: Applying to Other Components

A chapter that applies the cva, cn, Slot, and design-token patterns learned with Button to Badge, Input, Card, and Alert. We summarize a pattern-selection guide per component and design best practices.

Class components

In this chapter, you learn about React class components. Function components are the mainstream in modern React development, but you still need this knowledge to understand existing codebases and to implement Error Boundaries.

Components

In this chapter, you learn about components, the basic unit of React.

Custom hooks

In this chapter, you learn about custom hooks, which extract logic in a reusable form.

Debugging

In this chapter, you learn debugging techniques for React applications and how to use the React Developer Tools.

Design Systems and Design Tokens

A chapter that explains where the color of bg-primary comes from. You learn the two layers of design tokens (primitive / semantic), OKLCH colors, token definitions with Tailwind v4's @theme inline, and how light / dark themes work.

Designing a Design System with the shadcn/ui Button

Targets React 19 / Tailwind CSS v4 / the latest shadcn/ui. A 13-chapter guide that uses the Button to teach reusable component design aligned with a design system through design tokens, cva, cn, and Radix Slot.

Event handling

In this chapter, you learn about event handling in React.

Forms

In this chapter, you learn how to handle forms in React.

Forwarding ref: The React 19 Way

In this chapter, you learn how to access DOM elements using ref. We focus on the new React 19 style where ref is a normal prop, and also cover the traditional forwardRef.

From Button to a Design System

The final chapter that brings the design-token, cva, cn, Slot, and type patterns learned with Button into a single design system made of three layers (design tokens / primitives / patterns). It also introduces points for team operation and the next steps.

Frontend

A hub for the domain that collects notes on frontend development, such as React, Tailwind CSS, and shadcn/ui. It covers UI construction, styling, and component design.

Full-stack practical project

In this chapter, you integrate all the knowledge you have learned so far and build a project management app (Trello-like) with React + NestJS + Prisma.

Hands-On Practice: Building a Button Component from Scratch

A hands-on exercise that starts from a plain button and stacks Tailwind design tokens, cva, cn, asChild (Slot), and TypeScript types one step at a time to complete a shadcn/ui-style Button component from scratch. It includes bonus exercises for adding a success variant and a loading state.

How the cn function works: understanding clsx and tailwind-merge

A chapter that digs into the internal behavior of clsx and tailwind-merge, which make up the shadcn/ui cn function, along with actual results. You learn about excluding falsy values, conflict resolution via conflict groups, and why the order is clsx then twMerge.

Introduction to React

A 30-chapter guide that teaches modern React development (Vite + TypeScript + Tailwind CSS) systematically from the ground up. You can work through it step by step, from JavaScript prerequisites to Hooks, state management, performance, Next.js, and a full-stack implementation.

JavaScript basics (ES6+)

Before learning React, let's review the important features of modern JavaScript (ES6 and later). You use this knowledge frequently in React development.

Portals and Modals

In this chapter, you learn how to implement modals using React's createPortal.

Practical project

In this chapter, you leverage the knowledge you have learned so far to build a practical task management app.

Props

In this chapter, you learn about Props, the mechanism for passing data to components.

React + TypeScript

In this chapter, you learn type-safe frontend development that combines React and TypeScript.

Schema validation with Zod

Define schemas with Zod and learn type inference, React Hook Form integration, and runtime validation of API responses.

State (useState)

In this chapter, you learn about State, which manages a component's state.

Styling overview

In this chapter, you get an overview of styling approaches in React and learn the characteristics of each approach and how to choose between them.

Tailwind CSS (React integration patterns)

A chapter for using Tailwind CSS, which has become the de facto standard in React development, practically in React. Setup and basics are left to a separate guide; this chapter covers patterns specific to React integration, such as variant design, the clsx / tailwind-merge / cn utilities, and integration with shadcn/ui.

Tailwind CSS basics: utility-first

A chapter that teaches the utility-first idea of Tailwind CSS by breaking down the actual class list of the shadcn/ui Button. It explains layout, state modifiers (hover / focus-visible / disabled), the spacing scale, and an entry point into design tokens.

The basics of JSX

In this chapter, you learn JSX, the syntax for describing React's UI.

The goal of this book and what you will learn

The introductory chapter of a guide that teaches design system design using the shadcn/ui Button. It explains the book's goal, who it is for, the structure of all 13 chapters, and why the Button is the ideal subject for component design.

TypeScript Integration: Type-Safe Components

In this chapter, you learn about the TypeScript types that power the shadcn/ui Button. We cover props definitions using React.ComponentProps, VariantProps, and intersection types, and why React 19 no longer needs forwardRef generics.

useContext

In this chapter, you learn about the `useContext` hook, used to share data across the entire component tree.

useEffect

In this chapter, you learn about the `useEffect` hook, which handles side effects.

useReducer

In this chapter, you learn about the `useReducer` hook, used to manage complex state logic.

useRef and DOM manipulation

In this chapter, you learn about the `useRef` hook, used for direct DOM access and holding values, and related APIs.