Courses/Grit UI Components
Standalone Course~30 min10 challenges

Grit UI: Using the 100-Component Registry

Grit ships 100 shadcn-compatible React components across 5 categories. Install them into your project with a single command, customize the source code freely, and build complete pages from pre-built building blocks.


What is Grit UI?

Building UI from scratch is slow. Every project needs hero sections, login forms, pricing tables, dashboards, and navigation — and they all look roughly the same. Grit UI gives you 100 pre-built components that you install, own, and customize.

Component Registry: A collection of pre-built, installable React components served via an API. Instead of installing an npm package (where you can't modify the source), you download the actual TSX source code into your project. You own it completely — change colors, layout, text, add features. No version lock-in.

Grit UI includes 100 components across 5 categories:

  • Marketing (21) — hero sections, feature grids, pricing, testimonials, CTAs, footers
  • Auth (10) — login, register, forgot password, OTP, social login
  • SaaS (30) — dashboards, billing, settings, onboarding, analytics, teams
  • Ecommerce (20) — product cards, cart, checkout, orders, categories
  • Layout (20) — navbars, sidebars, footers, headers, app shells, page layouts

The registry is served by your Grit API at the /r endpoints. Every Grit project includes it automatically.

1

Challenge: Browse the Registry

Start your Grit API and open http://localhost:8080/r.json in your browser. How many components are listed? What fields does each component have? Can you find components in all 5 categories?

How the Registry Works

Your Grit API exposes two registry endpoints. The first lists all components. The second returns a specific component with its full source code.

Registry API
# List all 100 components
GET /r.json
# Returns: array of components with name, description, category

# Get a specific component
GET /r/hero-split.json
# Returns: full component data with embedded TSX source code

Each component JSON contains:

  • name — unique identifier (e.g., "hero-split")
  • description — what the component does
  • category — marketing, auth, saas, ecommerce, or layout
  • dependencies — npm packages the component needs (shadcn/ui primitives, lucide-react)
  • files — the full TSX source code, ready to copy into your project

The format is shadcn-compatible. This means any tool that works with the shadcn registry format (including the official CLI) can install Grit UI components.

2

Challenge: Fetch a Component

Fetch /r/hero-split.json from your API. What fields does the response contain? Look at the files field — can you see the full TSX source code? What dependencies does the component require?

Installing Components

Installing a Grit UI component uses the shadcn CLI. One command downloads the component source into your project. You own the code — it's not a dependency you import from node_modules.

Terminal
# Install a component from your local Grit API
npx shadcn@latest add hero-split --url http://localhost:8080/r

This downloads the hero-split.tsx file into your components directory (typically components/ui/ or wherever your shadcn config points). The file is now part of your project — edit it freely.

shadcn/ui: A component system where you copy source code into your project instead of installing an npm package. You get full control over every line of code. No version conflicts, no breaking updates, no fighting with a library's API. The tradeoff: you maintain the code yourself. For most teams, this is a much better deal.
Your API must be running when you install components. The shadcn CLI fetches the component JSON from your API's /r endpoint. Start your API with grit devor go run cmd/server/main.go first.
3

Challenge: Install Your First Component

Install a hero component using the shadcn CLI. Find the downloaded file in your project. Open it — can you read the TSX source code? Try importing it in a page and rendering it. Does it display correctly?

Marketing Components (21)

Marketing components are the building blocks of landing pages. Hero sections grab attention. Feature grids explain your product. Pricing tables convert visitors. Testimonials build trust. CTAs drive action.

Key marketing components:

  • hero-split — headline on the left, image on the right. Classic SaaS hero layout.
  • hero-centered — centered headline with CTA buttons below. Clean and focused.
  • features-grid — 3-column grid of feature cards with icons and descriptions.
  • pricing-three-tier — three pricing plans side by side with feature comparison.
  • testimonials-carousel — rotating customer quotes with avatars and company names.

A typical landing page stacks these components top to bottom: hero, features, testimonials, pricing, CTA, footer. Five components, one complete landing page.

Landing Page Structure
// A complete landing page from Grit UI components:
//
// HeroSplit - "Build faster with Grit"
// FeaturesGrid - 6 features with icons
// TestimonialsCarousel - 5 customer quotes
// PricingThreeTier - Free, Pro, Enterprise
// CTABanner - "Start building today"
// FooterLinks - Links, social, copyright
4

Challenge: Install 3 Marketing Components

Install hero-split, features-grid, and pricing-three-tier. Import all three into a page component and render them in order. You've just built a landing page in under 5 minutes.

Auth Components (10)

Auth pages are the first thing users see. They need to look polished, work on mobile, and handle edge cases (loading states, error messages, password visibility toggle). Grit UI's auth components handle all of this.

Key auth components:

  • login-card — email/password form with remember me, forgot password link, and social login buttons
  • register-card — name, email, password, confirm password with validation
  • forgot-password — email input with submit and back-to-login link
  • otp-input — 6-digit code input with auto-focus and paste support
  • social-buttons — Google, GitHub, Twitter login buttons styled consistently
These components handle the UI only — form layout, validation feedback, and styling. You still wire them up to your auth API endpoints. The scaffolded auth pages already call the API, so compare them side by side.
5

Challenge: Install Login Card

Install the login-card component. Compare it to your project's default login page. What's different? What's the same? Try replacing the default login page with the Grit UI version.

SaaS Components (30)

SaaS components power the authenticated app experience. Dashboards, settings pages, billing flows, onboarding wizards, analytics — the screens your paying users interact with daily. This is the largest category with 30 components.

Key SaaS components:

  • dashboard-stats — 4-card grid showing key metrics (users, revenue, growth, active)
  • billing-plans — subscription plan selector with monthly/yearly toggle
  • settings-profile — profile form with avatar upload, name, email, bio
  • onboarding-wizard — multi-step setup flow with progress indicator
  • analytics-chart — line/bar chart component for visualizing data over time

SaaS components often need data from your API. The components render the UI, and you connect them to your React Query hooks for data fetching. The pattern is always the same: fetch data, pass it as props, render the component.

Start with dashboard-stats — it's the most impactful. Replace static numbers with real data from your API and your dashboard instantly looks professional.
6

Challenge: Install SaaS Components

Install dashboard-stats, billing-plans, and settings-profile. Use dashboard-stats on your dashboard page. Pass in real numbers from your API (total users, total posts, etc.). How does it compare to the default dashboard?

Ecommerce Components (20)

Building an online store? Ecommerce components give you product displays, shopping cart, checkout flow, and order management. These are the most complex components — they handle state management, quantity updates, price calculations, and form validation.

Key ecommerce components:

  • product-card — image, title, price, add-to-cart button. Responsive grid item.
  • cart-drawer — slide-out cart panel with quantity controls and subtotal
  • checkout-form — shipping address, payment info, order summary
  • order-history — table of past orders with status badges and view details
  • category-grid — grid of product categories with images and counts
Ecommerce components pair with Grit's generated resources. Generate a Product resource with name, price, description, image, and category_id — then display them using the product-card component. The API provides the data, the component provides the UI.
7

Challenge: Install Product Card

Install the product-card component. If you have a Product resource, display your products using the component. If not, create a simple array of product data and render a grid of product cards. Customize the card's colors to match your app.

Layout Components (20)

Layout components define the structure of your app. Navbars, sidebars, footers, and app shells create the container that all other components live inside. Get these right and everything else falls into place.

Key layout components:

  • navbar-main — top navigation bar with logo, nav links, auth buttons, mobile menu
  • sidebar-collapsible — sidebar that collapses to icons on small screens
  • footer-links — multi-column footer with link groups, social icons, copyright
  • app-shell — complete app layout with sidebar, header, and content area
  • page-header — page title with breadcrumb and action buttons

The app-shell component is especially powerful — it combines a sidebar, header, and content area into a single component. Replace your entire app layout with one install.

8

Challenge: Install Navbar and Footer

Install navbar-main and footer-links. Replace your app's default navigation with these components. Update the nav links to match your routes. Does the mobile menu work correctly?

Customizing Components

The whole point of the copy-paste model is customization. After installing a component, the source code is in your project. Change anything: colors, layout, text, animations, add new props, remove features you don't need.

Common customizations:

  • Colors — swap Tailwind classes to match your brand. Change bg-primary to bg-blue-600
  • Text — replace placeholder copy with your product's real messaging
  • Layout — change from 3-column to 4-column grid, swap left/right positions
  • Props — add new props for dynamic data (prices, feature lists, user info)
  • Remove — delete sections you don't need (social login, testimonials, etc.)
Start by changing the text and colors. Then move to structural changes. Don't be afraid to delete code you don't need — the component is yours. You can always re-install the original version and start over.
9

Challenge: Customize a Component

Install a pricing component. Change the plan names and prices to match a fictional SaaS product (e.g., Starter $9/mo, Pro $29/mo, Enterprise $99/mo). Change the feature lists for each plan. Update the colors to match your app's theme. The component should look completely custom.

Summary

Here's everything you learned in this course:

  • Grit UI is a 100-component registry served by your API at /r endpoints
  • Components are shadcn-compatible: install with npx shadcn@latest add --url
  • You own the source code — copy-paste model, not dependency model
  • Marketing (21): heroes, features, pricing, testimonials, CTAs for landing pages
  • Auth (10): login, register, forgot password, OTP, social login forms
  • SaaS (30): dashboards, billing, settings, onboarding, analytics for app pages
  • Ecommerce (20): product cards, cart, checkout, orders for online stores
  • Layout (20): navbars, sidebars, footers, app shells for app structure
  • Customize freely: change colors, text, layout, add props, remove sections
  • Build complete pages by composing multiple registry components together
10

Challenge: Build a Landing Page from Components

Build a complete landing page for a fictional SaaS product using ONLY Grit UI components. Install and customize: (1) a hero component with your product's headline, (2) a features grid with 6 features, (3) a testimonials section with 3 quotes, (4) a pricing table with 3 plans, (5) a footer with links and social icons. Every section should be a Grit UI component, customized with your product's branding and copy. The entire page should look like a real product — not a template.