Skip to content
The Chat Archive
deepseek-v3-0324· DeepSeek LMArena Human Preference 140K

I am building out components from a design system. I am looking to organise them neatly.…

  1. User

    I am building out components from a design system. I am looking to organise them neatly. What name should I give the folder where components like Heading1 and BodyText live? is elements correct?

  2. Assistant

    Great question! The naming convention for folders in a design system can vary, but here are some common and clear options for your text-based components like Heading1, BodyText, etc.:

    Best Options:

    1. typography – This is the most precise and widely used term for text-related components (headings, paragraphs, captions, etc.).

      • Example: components/typography/Heading1
      • Why? It directly reflects the purpose (styling text) and aligns with design system standards.
    2. text – Simpler but less explicit than "typography."

      • Example: components/text/BodyText

    Other Alternatives (Less Ideal):

    • elements – Too vague. "Elements" could mean anything (buttons, icons, etc.).
    • base – Implies foundational components, not just text.
    • atoms (if using Atomic Design) – Works but is overly abstract unless your entire system follows this structure.

    Recommendation:

    Use typography if you want clarity and scalability (e.g., future additions like Caption or CodeBlock). Use text if you prefer brevity and your system is small.

    Side note: If these components are purely styles (not React/Vue components), consider a styles/typography.scss or tokens/typography.ts instead.

    Would you like suggestions for organizing other types of components (e.g., buttons, cards)?

  3. User

    if buttons lived in there also would elements be fine

  4. Assistant

    If buttons are also included in the same folder as Heading1 and BodyText, then elements could work—but it’s still a bit ambiguous. Here’s a breakdown of your options:

    1. If You Want a Broad Category (Buttons + Text):

    • elements – Acceptable, but vague.

      • Pros: Simple, flexible.
      • Cons: Could become a "junk drawer" for unrelated components.
      • Example:
        /elements  
          ├── Button  
          ├── Heading1  
          └── BodyText  
        
    • primitives – Slightly more precise (implies foundational UI pieces).

    • base – Also works if these are low-level building blocks.

    2. Better Approach: Split Them Up

    • typography (for text) + buttons (or actions) – More scalable.
      • Why? Buttons and text serve different purposes (interactivity vs. readability).
      • Example:
        /components  
          ├── typography  
          │    ├── Heading1  
          │    └── BodyText  
          └── buttons  
               └── Button  
        

    3. If You Must Group Them Together:

    Use atoms (if following Atomic Design), but only if your entire system uses this structure.

    Final Recommendation:

    • Avoid elements unless the folder is strictly for non-interactive primitives (e.g., text + icons).
    • Prefer separate folders (typography and buttons) for clarity as your system grows.

    Would you like a full example of a folder structure for a design system?

  5. User

    maybe /components ├── application
    └── typography
    │ ├── Heading1
    │ └── BodyText
    └── buttons
    └── Button
    ├── ui more complete ui blocks would go in here like hero, card etc

  6. Assistant

    Your structure is almost there! Here’s a refined, scalable version with clear intent for each folder and room for growth:

    Recommended Folder Structure

    /components
      ├── foundation/      # Lowest-level primitives (design system "tokens")
      │   ├── typography/  # Text styles (Heading1, BodyText, etc.)
      │   ├── buttons/     # Button variants (Primary, Secondary, IconButton)
      │   └── icons/       # Icon components
      │
      ├── ui/              # Mid-level UI blocks (reusable but not full layouts)
      │   ├── cards/       # Card variants
      │   ├── forms/       # Input, Checkbox, etc.
      │   └── navigation/  # Breadcrumbs, Tabs, etc.
      │
      └── application/     # High-level, context-specific components
           ├── hero/       # Marketing hero section
           ├── sidebar/    # App-specific sidebar
           └── dashboard/  # Complex data widgets
    

    Key Principles:

    1. foundation/

      • Atomic pieces (typography, buttons, icons).
      • Naming alternative: primitives/ or atoms/ (if using Atomic Design).
    2. ui/

      • Composed blocks (cards, forms) built from foundation components.
      • Naming alternative: blocks/ or molecules/ (Atomic Design).
    3. application/

      • Business-specific components (e.g., ProductCard, PricingTable).
      • Naming alternative: sections/ or templates/.

    Why This Works?

    • Scalable: No folder becomes a "junk drawer."
    • Clear Ownership: Engineers/designers know where to add/edit components.
    • Mirrors Design Tools: Matches how Figma/Sketch organize libraries (Base → Components → Patterns).

    Adjust Based on Needs:

    • Tiny system? Merge foundation and ui into components/.
    • Huge system? Split further (e.g., data-display/, feedback/ for modals/toasts).

    Would you like examples of how imports would look in this structure? (e.g., import { Button } from '@/components/foundation/buttons')

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.