FUI5003: Too many of a component in one region

moderate

A region contains more of a component than the composition policy allows.

Details

diagnostic
{
  "code": "FUI5003",
  "ruleId": "composition/cardinality",
  "category": "Composition",
  "defaultSeverity": "moderate",
  "lifecycle": "experimental",
  "fixAvailable": false,
  "evidenceRequired": true
}

Guidance

Reduce the matched component to the allowed count for that region. The classic case is more than one primary action in a single group — keep a single primary Button in a ButtonGroup and demote the others to a secondary or outline variant.

This rule is region-scoped: the count is per container (such as one ButtonGroup), not across the whole file, so two separate groups that each contain a single primary are fine. Only statically-resolved props are counted — a dynamic variant={kind} is treated as unknown, never as a match — so the rule never flags a value it cannot see at build time.