Skip to content

finding(components): RadioGroupSchema.orientation is declared by the type and the zod schema but read by nothing — the docs page's two Layout Options demos render byte-identical markup #6158

Description

@yinlianghui-tw

Found while implementing #6143 round 2. That card corrected content/docs/components/form/radio-group.mdx from the invented key direction to the shipped orientation. The correction is right — but orientation turns out to be declared-and-unconsumed, so the page now documents a real key that does nothing.

This is the mirror image of #6150 (keys renderers read that no type declares). Here the type declares a key no renderer reads.

Measured, from the prerendered HTML rather than by eye

orientation is declared in both layers:

  • packages/types/dist/form.d.ts:377orientation?: 'horizontal' | 'vertical'; with @default 'vertical'
  • packages/types/dist/zod/form.zod.js:263orientation: z.enum(['horizontal', 'vertical']).optional().describe('Layout orientation')

It is read nowhere. packages/components/src/renderers/form/radio-group.tsx contains neither the string orientation nor direction. The renderer passes defaultValue, className, form-control DOM props and designer props to the Radix RadioGroup, and nothing else off schema.

The consequence is visible in the built site. next build of apps/site, then reading .next/server/app/docs/components/form/radio-group.html: all eight rendered radiogroup roots on the page are identical —

role="radiogroup" aria-required="false" dir="ltr" class="grid gap-2" data-obj-type="radio-group" style="outline:none" tabindex="-1"

No data-orientation attribute is emitted on any of them, and no direction attribute appears anywhere in the page. So the two demos under the page's ## Layout Options heading — vertical-layout and horizontal-layout — produce byte-identical markup. The horizontal demo renders vertically.

Radix's own RadioGroup does accept an orientation prop, so the capability is one forwarded prop away; the renderer simply never forwards it.

Why this is worth a card rather than a shrug

The page has a whole section demonstrating a distinction the product cannot make, and it is a distinction an author would reasonably expect from a declared, defaulted, zod-validated enum. An AI author reading the shipped type has every reason to emit orientation: 'horizontal' and no way to discover it is inert.

⚠️ Note that the two fixtures behind those demos currently pass direction, not orientation, so they would stay inert even after the renderer is fixed — filed separately as the fixture divergence card alongside this one.

Shape of the fix, not taken here

Forward schema.orientation to the Radix RadioGroup and let the flex/grid class follow it. That is a renderer behaviour change, out of scope for a docs card, and it should probably be decided together with #4631, which is the general statement of this class: a component type with three declared surfaces (TS schema type, registry meta inputs, renderer prop reads) that disagree with nothing reconciling them. The registry meta inputs for radio-group list only defaultValue, id, options, className — a third surface that also omits orientation.

Refs: #6143 (where this was found) · #6150 (the inverse class, undeclared-but-consumed) · #4631 (the general three-surfaces statement) · #4653 (the same class of key drift, closed per-page).

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions