Problem
A component's primary slot is treated as "children" only when Figma happens to name the prop children. Any other name — items, content — is treated as a secondary slot, which is an accident of authoring rather than a statement of intent.
Consequences on both surfaces:
React consumers pass a fragment to a named prop instead of nesting children:
<AvatarGroupitems={<><Avatar/><Avatar/></>}/>// today<AvatarGroup><Avatar/><Avatar/></AvatarGroup>// intendedWeb Components emit a NAMED slot, so projected content must sit inside a holder carrying slot="items". The holder is then the only assigned node, and ::slotted() cannot style a slotted node's descendants — so the component cannot style its own projected children at all.
That last point already forced a workaround: a component whose slot children overlap (negative item spacing) cannot express it in its stylesheet, so the margin is inlined onto generated example content and is absent for real consumers.
Solution
The workspace declares which slot prop is a component's children. One declaration, two platform behaviours:
- Web Components emit an unnamed
<slot>; consumers write plain children, and every child is an assigned node reachable by ::slotted() - React emits the prop as
children; consumers nest
Likely per-component rather than one workspace-wide name, since components name their primary slot differently.
Acceptance criteria
Workspace
Surfaced during component-by-component polish of React and web component output, reviewing both builds side by side in one Storybook.
Impacted code
- conventions config and its schema
- slot emission in both transform packages
- slot content composition in both packages
- the css transform's overlap rule, which can drop its inline workaround once children are reachable
Notes
Inferring from the prop name is the same class of fragility as keying off how many slots a component has: both make consumer markup depend on something unrelated to intent.
Implementation details are tracked internally.
Problem
A component's primary slot is treated as "children" only when Figma happens to name the prop
children. Any other name —items,content— is treated as a secondary slot, which is an accident of authoring rather than a statement of intent.Consequences on both surfaces:
React consumers pass a fragment to a named prop instead of nesting children:
Web Components emit a NAMED slot, so projected content must sit inside a holder carrying
slot="items". The holder is then the only assigned node, and::slotted()cannot style a slotted node's descendants — so the component cannot style its own projected children at all.That last point already forced a workaround: a component whose slot children overlap (negative item spacing) cannot express it in its stylesheet, so the margin is inlined onto generated example content and is absent for real consumers.
Solution
The workspace declares which slot prop is a component's children. One declaration, two platform behaviours:
<slot>; consumers write plain children, and every child is an assigned node reachable by::slotted()children; consumers nestLikely per-component rather than one workspace-wide name, since components name their primary slot differently.
Acceptance criteria
childrenin ReactWorkspace
Surfaced during component-by-component polish of React and web component output, reviewing both builds side by side in one Storybook.
Impacted code
Notes
Inferring from the prop name is the same class of fragility as keying off how many slots a component has: both make consumer markup depend on something unrelated to intent.