What is Infa
Infa Chrome Extension
How to use and install our Chrome Extension
Community
Browse community design systems
Release Notes
Featuring the latest changes to keep you up-to-date
Research Program
Participate in shaping the future of Infa
SOC 2 Type II Compliance Badge
Enterprise Ready
SOC 2 Type II certified for enterprise-level security and compliance
EventsLearnPricing
Sign up for free

Feedback

Share your feedback

Close
Anonymous submissions are auto-posted to #feedback channel. You can also share directly in Slack.

Need help?

Reach out to contact@infa.ai or see docs

Navigation
Search...
⌘ K
Focus sentinel
Close

Search Documentation

PressESCto close
Focus sentinel
Infa Documentation
  • General Information
    • Boards
    • Components
      • Main Components Vs Component Views
      • Component Tagging
      • Component Anatomy
    • Labels
    • Teams
    • Authentication
    • Permissions
      • Inviting People to Teams
      • Inviting People to Boards
    • Billing & Subscription
      • Managing Subscription
      • Promo Code Activation
    • Data Import, Export & Sync
      • Local vs. Cloud Boards
  • App Blocks
    • Building App Blocks
  • Chrome Extension
    • Deep Links
    • Using Labels
    • Updating the Extension
  • Integrations
    • MCP Server
    • Claude Code Plugin
    • External API
    • Progressive Web App
    • Figma Plugin
    • Coda Pack
    • Overview
    • Managing Runs
    • Board Agents
    • Overview
    • Infa Capture
    • Installation
    • Authentication
    • Connect a Board
    • Run Modes
    • Hooks & Agents
    • File Sync
    • CLI Reference
Switch to Light theme
Switch to Dark theme
TermsPrivacyChat with Us
  1. Docs
  2. General Information
  3. Components

Component Tagging Strategies

Learn about different strategies for tagging components in your product to improve design system adoption and tracking.

Component tagging is a crucial part of design system adoption and tracking. By properly tagging components in your product, you can gain valuable insights into how your design system is being used and identify areas for improvement.

Copy link
Three Effective Tagging Approaches

Based on industry best practices and our experience at Infa.ai, we recommend three main approaches to component tagging:

  • This approach involves adding specific class names or prefixes to your components to identify them as part of your design system.

    Example:

    example.html
    Copy code
    Copy code
    <button type="button" class="ds-button ds-button--primary">Submit</button>

    Pros:

    • Easy to implement in existing codebases
    • Works with any framework or technology
    • Can be added incrementally

    Cons:

    • Requires discipline to maintain consistency
    • May conflict with existing class naming conventions
    • Limited metadata capabilities
  • This approach uses custom elements (Web Components) to represent design system components.

    Example:

    example.html
    Copy code
    Copy code
    <ds-button variant="primary">Submit</ds-button>

    Pros:

    • Clear visual distinction in code
    • Enforces proper component usage
    • Supports rich metadata through attributes

    Cons:

    • Requires more setup and infrastructure
    • May not be compatible with all frameworks
    • Higher learning curve for developers
  • This approach uses HTML data attributes to mark components and provide metadata.

    Example:

    example.html
    Copy code
    Copy code
    <button type="button" data-ds-component="button" data-ds-variant="primary">
    Submit
    </button>

    Pros:

    • Works with existing HTML elements
    • Highly flexible for metadata
    • Easy to query and analyze

    Cons:

    • More verbose than other approaches
    • Requires consistent attribute naming
    • May lead to attribute bloat

Copy link
Choosing the Right Approach

The best tagging approach depends on your specific needs and constraints:

  • Class-Based Tagging is ideal for existing projects with minimal changes
  • Element Renaming works well for new projects or complete redesigns
  • Data Attributes offers a good balance of flexibility and ease of implementation

Many teams use a combination of these approaches to get the best results.

Content Feedback

Feedback on selected content

Close
Anonymous submissions are auto-posted to #feedback channel. You can also share directly in Slack.

Need help?

Reach out to contact@infa.ai or see docs

Previousmain-components-vs-component-views
Nextcomponent-anatomy