Linking Components
Connect scanned components to patterns for comprehensive design system tracking.
Overview #
When you scan your codebase with UiPool, you discover both patterns (high-level UI workflows) and components (reusable building blocks). Linking components to patterns creates a complete picture of how your design system is implemented.
Component linking is done in the UiPool dashboard, not in code. This keeps your codebase clean while providing rich relationship data.
Why Link Components to Patterns? #
- →Understand composition — See which components make up each pattern
- →Track coverage — Know which patterns have proper component implementations
- →Impact analysis — When updating a component, see which patterns are affected
- →Documentation — Auto-generate pattern documentation showing required components
Linking in the Dashboard #
To link components to a pattern:
- 1Navigate to Patterns and select a pattern
- 2In the Components section, click + Manage
- 3Search and select the components that belong to this pattern
- 4Click Save changes to persist the relationships
Use the search box to quickly find components by name, category, or description.
Using Annotations for Auto-Linking #
You can also annotate your code so components are automatically associated during scans:
LoginForm.tsx
// uipool-pattern: login-flow
export function LoginForm() {
return (
<form className="login-form">
{/* uipool-component: text-input */}
<TextInput label="Email" type="email" />
{/* uipool-component: text-input */}
<TextInput label="Password" type="password" />
{/* uipool-component: button-primary */}
<Button variant="primary">Sign In</Button>
</form>
);
}When both the pattern and component appear in the same file, UiPool can suggest linking them automatically.
Viewing Linked Components #
Once linked, components appear in the pattern detail page:
- Component name and category badge
- Photo preview on hover (if component has photos)
- Click to navigate to the component detail page
Removing Links #
To unlink a component from a pattern:
- 1Open the pattern and click + Manage in the Components section
- 2Uncheck the component you want to remove
- 3Click Save changes
Removing a link doesn't delete the component—it only removes the relationship.
Best Practices #
- •Link atomic components — Focus on reusable building blocks, not one-off implementations
- •Use consistent naming — Ensure component IDs in code match your design system terminology
- •Review after scans — Check for new components that should be linked after each scan
- •Document slots — Use the notes field to describe how the component fits in the pattern