Back to Workshop Hub

Design Systems + Lovable

How design systems translate into better vibe coding. Define your tokens, name your components, and let Lovable build with consistency.

💡 Why This Matters

As a PM, understanding design systems helps you write better prompts and build more consistent prototypes. When you give Lovable a clear design system — specific colors, fonts, spacing, and component patterns — every screen it generates looks like it belongs to the same product. Your design system is your quality control.

What Is a Design System?

A design system is more than a style guide — it's a shared language between designers and developers. It includes design tokens (colors, spacing, typography), reusable components (buttons, cards, modals), patterns (how components combine), and documentation. When you vibe code, your design system becomes the vocabulary you use in your prompts.

Tokens = the raw values (colors, sizes, spacing, shadows)
Components = reusable UI pieces (buttons, inputs, cards, navigation)
Patterns = how components combine to solve user problems (auth flow, checkout, dashboard)
Documentation = the shared understanding that keeps everything consistent

Design Tokens → Prompts

Design tokens are the atomic values of your system. When you feed these to Lovable, you're establishing rules that every generated component will follow. Be explicit — hex codes, pixel values, and named scales.

Colors: "Primary: #ff6b6b, Secondary: #574b90, Background: #0a0a1a, Surface: #1a1a2e"
Spacing: "Use an 8px grid — 8, 16, 24, 32, 48, 64 for all margins and padding"
Border radius: "Small elements: 8px, cards: 16px, modals: 24px"
Shadows: "Subtle shadow for cards, prominent shadow for modals and dropdowns"
Typography scale: "12px caption, 14px body-small, 16px body, 24px h3, 32px h2, 48px h1"

Example Prompt

Set up a design system with these tokens: Primary color #ff6b6b, secondary #574b90, dark background #0a0a1a, surface #1a1a2e, text white. Use 8px spacing grid. Border radius 12px for cards, 8px for buttons. Add subtle box shadows on hover.

Component Libraries (shadcn/ui)

Lovable uses shadcn/ui — a collection of beautifully designed, accessible components built on Radix UI. You don't need to know the code, but knowing component names helps you write precise prompts. Think of it as a catalog you can reference by name.

Reference by name: "Add a shadcn Dialog for the settings modal"
Combine components: "Use a Card with a Badge in the top-right corner"
Specify variants: "Use the outline button variant for secondary actions"
Common components: Button, Card, Dialog, Sheet, Tabs, Accordion, Badge, Avatar, Input, Select
Browse the catalog at ui.shadcn.com to see what's available

Example Prompt

Create a user profile card using shadcn Card component. Include an Avatar (64px), the user's name as a heading, their role with a Badge component, and two buttons — 'Edit Profile' (default variant) and 'Settings' (outline variant).

Consistency Through Prompting

The secret to a polished app: define your system in your first prompt. Once Lovable establishes your design tokens, every subsequent prompt inherits those styles. It's like setting up your Figma styles library before designing — front-load the decisions.

First prompt = your system setup (colors, fonts, spacing, component style)
Follow-up prompts can focus on functionality — the styling is already established
Reference existing elements: "Match the style of the hero section" or "Use the same card style as the features grid"
If styles drift, reset with: "Apply the design system consistently across all sections"

Example Prompt

Build a landing page with this design system: Dark theme (#0f0f1a background), coral accent (#ff6b6b), Space Grotesk for headings, DM Sans for body text. Cards have frosted glass effect (white/5 background, white/10 border). Buttons are coral with white text. Use 24px gap in grids, 64px between sections.

From Figma Components to Code Components

Your Figma components have structure — auto-layout, variants, naming conventions. These map directly to how you describe components to Lovable. The better organized your Figma file, the better your prompts.

Figma auto-layout → CSS flexbox/grid ("horizontal layout with 16px gap")
Figma variants → component states ("default, hover, active, disabled states")
Figma component naming → clear descriptions ("PrimaryButton/Large" → "large primary button")
Figma constraints → responsive behavior ("pin to edges" → "full-width on mobile")
Figma component properties → props ("toggle icon visibility" → "button with optional icon")

Example Prompt

Create a feature card component with two variants: default (white/5 background) and highlighted (primary color border glow). Each card has an icon (32px, in a rounded container), heading, description text, and an optional 'Learn more' link. Stack vertically with 16px internal spacing.

Tailwind CSS as Your Token Layer

Under the hood, Lovable uses Tailwind CSS — a utility-first CSS framework. Your design tokens become CSS custom properties that Tailwind classes reference. You don't need to write CSS, but understanding this connection helps you speak Lovable's language.

Your hex colors become CSS variables: --primary, --secondary, --background
Spacing uses Tailwind's scale: p-4 = 16px, gap-6 = 24px, mt-8 = 32px
You can reference Tailwind concepts: "rounded-xl", "shadow-lg", "backdrop-blur"
Dark/light mode is handled through CSS variables — define both sets in your system
You don't write Tailwind — you describe the result and Lovable picks the right classes

Example Prompt

Update the color system: set --primary to coral (#ff6b6b), --background to near-black (#0a0a1a), --foreground to white (#fafafa). Cards should use backdrop-blur-sm with a semi-transparent background. Add a subtle glow effect (box-shadow with primary color at 25% opacity) on interactive elements.

Building Your Own Mini Design System

Here's a workshop exercise: define a complete mini design system in a single prompt. This is the most powerful way to start any project — nail the foundation, then build features on top.

Step 1: Choose 4 colors — background, surface, primary accent, text
Step 2: Pick 2 fonts — one for headings (expressive), one for body (readable)
Step 3: Define your spacing scale — base unit and multipliers (e.g., 8px grid)
Step 4: Describe 3 core components — button, card, and navigation bar
Step 5: Combine it all into one system-setup prompt

Example Prompt

Create a portfolio website with this design system: Colors: Background #1a1a2e, Surface #25254a, Accent #e94560, Text #eaeaea Fonts: Syne for headings (bold, uppercase for section titles), Inter for body Spacing: 8px base grid, 24px card padding, 48px section spacing Components: - Button: rounded-full, accent background, white text, hover brightness increase - Card: surface background, 1px border at white/10, 16px border radius, subtle hover lift - Navbar: fixed top, blurred background, logo left, links right, accent CTA button Build a hero section and a 3-column project grid using this system.

Want to translate your Figma designs into prompts?

Figma → Lovable Guide →

Ready to build with a system?

Open Lovable