Skip to content

UI: Add Item - #86676

Open
jasmussen wants to merge 26 commits into
trunkfrom
try/new-itemgroup
Open

jasmussen wants to merge 26 commits into
trunkfrom
try/new-itemgroup

Conversation

@jasmussen

@jasmussen jasmussen commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #64445. See #34709 and #86451.

What?

Adds the Item family to @wordpress/ui: rows for lists of items and settings, composed from parts, with Item.Group to list them.

Why?

Several screens build this row by hand, each with its own markup and accessibility story: the site editor sidebar, the font library, the block inspector's color rows, and the settings-page patterns from #86451. __experimentalItemGroup has no @wordpress/ui successor, and it only provides the container.

How?

  • Three kinds of row. The component name says what users can activate:
    • Item.LinkRow: the whole row is a link.
    • Item.ButtonRow: the whole row is a button.
    • Item.ContentRow: only the controls in Item.Actions are interactive.
  • Parts. Item.Media, Item.Label, Item.Description, Item.Meta, Item.Chevron and Item.Actions.
  • No nested controls. The link or button of a row is an empty element that covers the row. Controls in Item.Actions sit above it, so nothing interactive is nested. This is the technique the DataViews list layout uses. The row control takes its name from Item.Label, and its description from Item.Description and Item.Meta.
  • Groups. Item.Group renders a ul, and each row inside it an li. variant="joined" (the default) draws one frame with a line between rows. variant="detached" gives each row its own frame and keeps one list.
  • Frames. A row outside a group draws its own frame. Inside Card.FullBleed the card is the frame: the group keeps only a line under the card header, and none at the top edge of the card. Its first and last rows follow the corners of the card, so the focus ring is not clipped.
  • New tab. Item.LinkRow accepts openInNewTab and target, as Link and Menu.LinkItem do. Item.Chevron then shows the new-tab arrow, and the link name gets "(opens in a new tab)".
  • Long text. Labels, descriptions and meta wrap, even a long URL or file name, so they never run under the actions. Item.Meta takes at most a quarter of the row.

Outside packages/ui, this PR only adds the __experimentalItem: 'WCItem' ESLint import alias in tools/eslint/components-import-aliases.mjs. #87488 already renamed the legacy __experimentalItem imports to WCItem, so they do not collide with the new export.

Example
<Item.Group aria-label={ __( 'Background' ) } density="compact">
	<Item.ButtonRow onClick={ openColorPicker }>
		<Item.Media>{ swatch }</Item.Media>
		<Item.Label>{ __( 'Color' ) }</Item.Label>
		<Item.Meta>{ color }</Item.Meta>
		<Item.Actions>
			<IconButton icon={ reset } label={ __( 'Reset background color' ) } onClick={ resetColor } size="small" />
		</Item.Actions>
	</Item.ButtonRow>
</Item.Group>
Decisions from the review thread
  • Named parts instead of a prop-based ItemGroup, following shadcn/ui's Item.
  • A row with Item.Actions shows no chevron. Item.Chevron warns in development when both are present.
  • Item.Actions does not change its children. Each control needs a name that includes its row, such as "Reset background color".
  • Interactive elements go in Item.Actions, including the trigger of an infotip. Item.Media, Item.Label, Item.Description and Item.Meta stay static.
  • Actions are always visible, not revealed on hover. Controls that do not fit beside the row go in a Menu in Item.Actions, as the With Overflow Menu story shows.
  • In a link or button row, the label is hidden from assistive technology, because it already names the row's control. So it must not be a heading. A heading that names a group goes outside the rows, as the Inside A Collapsible Card story shows.
  • separated became variant="detached". The usage guidelines explain when to use joined rows, detached rows or separate groups.
  • Item.Media is a plain slot, with no tile behind it, because it also holds swatches, logos and thumbnails.

Testing Instructions

  1. Run npm run storybook:dev and open Components → @wordpress-ui → Item.
  2. In Default, click anywhere on a row, including its description and badge. The row should behave as one link.
  3. In Button Row With Actions, hover the reset button. The row tint should drop, so the hover style of the button stays visible. Clicking the reset button should not activate the row.
  4. In Inside A Card, check that the rows run from edge to edge under the card header, with one line between the header and the first row.
  5. In Standalone, check that the row draws its own frame.
  6. In With Overflow Menu, open the menu of a row. It should open without following the row's link.
  7. In Inside A Collapsible Card, collapse and expand the card. Under each heading, the rows should run from edge to edge, with a line above the first row.
  8. Open Item → Usage Guidelines and check that the examples match the text.
  9. In the Storybook toolbar, turn on WordPress global CSS and check that the stories look the same.

Testing Instructions for Keyboard

  1. In Default, press Tab. Each row should receive focus once, with a focus ring inside the frame, and Enter should follow the link.
  2. In Row Types, the content row should not receive focus itself. Its Edit and Remove buttons should, in order.
  3. In Button Row With Actions, Tab should reach the row and then the reset button.
  4. In Inside A Card, focus the last row. Its focus ring should follow the rounded corners of the card, not be clipped by them.
  5. In With Overflow Menu, Tab should reach each row and then its menu button, named "More actions for" and the row's name.
  6. With a screen reader, a link row should be announced once, by its label, followed by its description and status. The label text should not be read a second time. In Inside A Collapsible Card, each list should be named by the heading above it.

Screenshots or screencast

This PR adds a new component, so there is no "before" in trunk. All screenshots come from a local storybook/build of e7a30e3840c, and the collapsible card one from bb496a9da2f, before the rebase onto trunk. The rebase leaves the component code unchanged.

Default Inside a card, last row focused
Two settings rows, Users and General, with icons, descriptions, a badge and chevrons, joined in one frame A Notifications card with two rows edge to edge; the focus ring of the last row follows the rounded corners of the card
Stories
Row types Button row with an action
A link row, a button row, and a content row with Edit and Remove buttons A compact color row with its value and a reset button
Detached Standalone
Two connector rows, each in its own frame, with a button each A single Export row with its own frame
Inside a card Inside a collapsible card
A Notifications card with a header, and two rows edge to edge below a line A collapsible card titled More settings. Under the Site and Content headings, each group runs from edge to edge with a line above its first row, and an All settings link follows them
With an overflow menu Overflow menu open
Three service rows, Payments, Analytics and Email delivery, each with a connection badge and a three-dot menu button The menu of the Payments row is open, with View documentation and Disconnect
Usage guidelines examples
Joined Separate groups
Two rows joined in one frame Two groups, each under its own heading
Focus and hover
Keyboard focus on the first row Hover on a row
The focus ring is drawn inside the first row and follows the top corners of the frame The hovered row has a tint
Hover on an action
The reset button shows its own hover, and the row has no tint
Right-to-left, dark theme, and WordPress global CSS

Storybook's RTL mode keeps the English text, so the browser moves its punctuation and the number in the badge.

Right-to-left Right-to-left, row types
The rows mirrored, with the chevron on the left Row types mirrored, with the actions on the left
Dark theme Dark theme, inside a card
The default story in the dark theme The card story in the dark theme
WordPress global CSS WordPress global CSS, row types
The default story with WordPress admin styles loaded, unchanged Row types with WordPress admin styles loaded, unchanged

TODO / Follow-ups

  • Design review: a minimum row height, so that a row with a compact control (64px) matches a row with only a chevron (56px).
  • Design review: in a narrow row with a long meta and wide actions, the meta keeps its quarter of the row and the label wraps first, mid-word if it has to. The grid cannot make the meta give way first without letting the actions overflow the row. Icon buttons in Item.Actions avoid this in narrow containers such as the editor sidebar.
  • Drag-and-drop sorting, as Expand ItemGroup #64445 asks for ("Has re-ordering") and Components: add sortable, multi-selectable list #66413 explores. The current API leaves room for it without breaking changes:
    • A new part for a leading handle, which sits above the control of the row as Item.Actions does. Item.Media is now documented as holding no control, so nobody puts a handle there in the meantime.
    • Optional ordering props on Item.Group, or a separate sortable group. The list keeps its ul and li semantics.
    • Dragging starts only from the handle, never from the row, so it does not compete with the link or button of the row.
    • To make it accessible, the handle also opens a menu with Move up, Move down, Move to top and Move to bottom. That works with a keyboard, a screen reader in browse mode, speech input, and a single pointer (WCAG 2.1.1 and 2.5.7). Each move is announced, and focus stays on the handle of the moved row.
  • Migrate the site editor sidebar, the font library and the block inspector's color rows.
  • hidden support across @wordpress/ui. Components set their own display, which overrides the attribute, so for now the usage guidelines tell consumers to hide a row by not rendering it.
Earlier prop-based prototype (screenshots from the first version of this PR)

The prototype link now shows a later build that uses the current API.

Compact rows in the earlier prototype Compact rows in Global Styles in the earlier prototype Settings rows in the earlier prototype Settings → Connectors in the earlier prototype Appearance → Fonts in the earlier prototype

Use of AI Tools

Most of this branch was written with AI assistance (Claude) and reviewed by people in the thread. The first version was written with Claude Opus. The current API and the fixes from review were written with Claude Code, and each round was checked by an independent AI reviewer (GPT 6.2 Astra, then Claude Opus 5.5 for the final round), with tests added for every confirmed defect.

🤖 Generated with Claude Code

@jasmussen
jasmussen requested a review from a team November 11, 2026 13:54
@jasmussen jasmussen self-assigned this Nov 11, 2026
@jasmussen
jasmussen requested a review from a team as a code owner November 11, 2026 13:54
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system labels Nov 11, 2026
@github-actions github-actions Bot added the [Package] UI /packages/ui label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: poligilad-auto <poligilad@git.wordpress.org>
Co-authored-by: lucyneb <lucybbn@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +7.03 kB (+0.08%)

Total Size: 8.73 MB

📦 View Changed
Filename Size Change
build/modules/boot/index.min.js 55.2 kB +56 B (+0.1%)
build/modules/core-fields/attachment.min.js 44.3 kB +110 B (+0.25%)
build/modules/core-fields/page.min.js 7.21 kB +52 B (+0.73%)
build/modules/core-fields/post_type_supports.min.js 82.6 kB +170 B (+0.21%)
build/modules/core-fields/wp_template_part.min.js 39.5 kB +51 B (+0.13%)
build/modules/core-fields/wp_template.min.js 11.7 kB +48 B (+0.41%)
build/modules/workflow/index.min.js 42.9 kB +158 B (+0.37%)
build/scripts/block-directory/index.min.js 42.6 kB +57 B (+0.13%)
build/scripts/block-editor/index.min.js 562 kB +670 B (+0.12%)
build/scripts/block-library/index.min.js 431 kB +336 B (+0.08%)
build/scripts/components/index.min.js 356 kB +223 B (+0.06%)
build/scripts/customize-widgets/index.min.js 22.9 kB +45 B (+0.2%)
build/scripts/edit-site/index.min.js 386 kB +2.26 kB (+0.59%)
build/scripts/edit-widgets/index.min.js 29.2 kB +105 B (+0.36%)
build/scripts/editor/index.min.js 576 kB +1.28 kB (+0.22%)
build/scripts/format-library/index.min.js 73.7 kB +119 B (+0.16%)
build/scripts/media-utils/index.min.js 240 kB +1.06 kB (+0.45%)
build/scripts/notices/index.min.js 48 kB +76 B (+0.16%)
build/scripts/patterns/index.min.js 12.6 kB +52 B (+0.41%)
build/scripts/widgets/index.min.js 65.2 kB +106 B (+0.16%)

69ed0f0 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 1c5b1cf trunk % Change
timeToFirstByte 49.25 ms +8.43% -2.64% 48.6 ms +5.14% -2.57% 1.34%
largestContentfulPaint 76 ms +13.16% -0% 76 ms +5.26% -5.26% 0%
lcpMinusTtfb 27.5 ms +15.82% -8.55% 26.7 ms +8.61% -6.18% 3%
wpBeforeTemplate 24.82 ms +9.11% -2.46% 24.52 ms +4.85% -1.63% 1.22%
wpTemplate 20.44 ms +3.18% -2.05% 19.95 ms +7.57% -1.9% 2.46%
wpTotal 45.06 ms +9.99% -1.51% 45.07 ms +5.08% -2.84% -0.02%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 1c5b1cf trunk % Change
timeToFirstByte 40.8 ms +3.19% -3.31% 39.4 ms +4.19% -2.28% 3.55%
largestContentfulPaint 76 ms +13.16% -5.26% 72 ms +0% -5.56% 5.56%
lcpMinusTtfb 32.7 ms +24.16% -2.91% 30.95 ms +5.98% -2.58% 5.65%
wpBeforeTemplate 21.58 ms +7.23% -1.85% 21.04 ms +4.47% -1.95% 2.57%
wpTemplate 15.65 ms +9.58% -3.83% 15.27 ms +0.98% -5.83% 2.49%
wpTotal 37.82 ms +2.64% -3.31% 36.36 ms +5.09% -2.97% 4.02%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 1c5b1cf trunk % Change
mediaProcessingJpeg 385.61 ms +0.49% -0.61% 383.66 ms +0.21% -0.92% 0.51%
mediaProcessingAvif 5640.72 ms +0.41% -0.2% 5662.75 ms +0.33% -0.16% -0.39%
mediaProcessingJpegToAvif 3870.15 ms +0.34% -0.26% 3887.49 ms +0.4% -0.28% -0.45%

media-upload

Metric 1c5b1cf trunk % Change
jpegUploadProcessing 1486.66 ms +34.52% -1.2% 1474.43 ms +0.54% -0.56% 0.83%
pngUploadProcessing 243.62 ms +1.72% -5.03% 237.65 ms +4.07% -2.58% 2.51%
largeJpegUploadProcessing 1462.07 ms +0.69% -0.56% 1464.42 ms +0.18% -0.76% -0.16%
multipleImageUploadProcessing 1625.62 ms +0.8% -0.36% 1613.29 ms +1.14% -0.9% 0.76%

post-editor

Metric 1c5b1cf trunk % Change
serverResponse 494.32 ms +2.37% -7.87% 446.35 ms +10.59% -0.63% 10.75%
firstPaint 443.35 ms +15.99% -6.19% 440.78 ms +4.58% -7.7% 0.58%
domContentLoaded 860.33 ms +3.24% -1.28% 848.39 ms +0.62% -2.11% 1.41%
loaded 861.58 ms +3.22% -1.3% 849.43 ms +0.64% -2.09% 1.43%
firstContentfulPaint 486.18 ms +5.77% -2.7% 475.69 ms +2.57% -2.76% 2.21%
firstBlock 2314.28 ms +0.17% -1.16% 2294.61 ms +1.11% -1.22% 0.86%
type 18.85 ms +7.64% -3.71% 20.11 ms +6.61% -10.69% -6.27%
typeWithoutInspector 18.79 ms +2.82% -14.48% 18.55 ms +3.13% -5.07% 1.29%
typeWithTopToolbar 24.07 ms +7.15% -3.53% 25.2 ms +12.9% -7.7% -4.48%
typeContainer 8.55 ms +10.99% -10.64% 8.19 ms +10.5% -10.99% 4.4%
focus 119.55 ms +7.91% -7.91% 108.46 ms +11.6% -3.59% 10.22%
firstFocus 273.82 ms +0% -0% 274.51 ms +0% -0% -0.25%
selectAll 421.74 ms +2.88% -1.93% 413.39 ms +1.02% -2.41% 2.02%
undo 31.1 ms +3.76% -7.72% 30.32 ms +6.79% -4.39% 2.57%
listViewOpen 38.21 ms +16.67% -4.68% 39.7 ms +5.77% -2.8% -3.75%
inserterOpen 42.51 ms +10.61% -10.09% 47.92 ms +6.14% -19.12% -11.29%
inserterHover 11.24 ms +7.74% -6.41% 11.74 ms +15.08% -10.73% -4.26%
inserterSearch 8.12 ms +4.19% -4.19% 8.72 ms +8.14% -10.55% -6.88%
loadPatterns 690.41 ms +5.46% -1.2% 686.41 ms +4.8% -6.25% 0.58%
wpTotal 484.71 ms +2.36% -8.44% 436.57 ms +10.83% -0.64% 11.03%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 1c5b1cf trunk % Change
serverResponse 267.99 ms +3.19% -7.42% 260.88 ms +2.11% -5.93% 2.73%
firstPaint 321.96 ms +6.17% -10.01% 292.66 ms +6.3% -5.62% 10.01%
domContentLoaded 584.67 ms +7.4% -1.15% 560.77 ms +2.01% -0.83% 4.26%
loaded 585.46 ms +7.41% -1.15% 561.56 ms +2.04% -0.83% 4.26%
firstContentfulPaint 339.42 ms +12.34% -3.69% 316.61 ms +1.73% -0.94% 7.2%
firstBlock 1790.65 ms +3.33% -2.01% 1735.51 ms +1.11% -1.3% 3.18%
type 13.79 ms +4.35% -6.24% 12.23 ms +9.16% -3.52% 12.76%
navigate 74.58 ms +6.06% -5.94% 73.87 ms +1.83% -9.14% 0.96%
loadPatterns 1005.73 ms +7.49% -7.86% 1015.72 ms +5.77% -2.5% -0.98%
loadPages 931.33 ms +3.01% -0.88% 938.57 ms +3.85% -1.46% -0.77%
wpTotal 261.35 ms +3.23% -7.58% 254.39 ms +2.03% -6.15% 2.74%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

69ed0f0 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Navigates the list via UP/DOWN arrow keys from action buttons in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-179-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:243:5
keeps the default tab on the moved tab in /test/e2e/specs/editor/blocks/tabs.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/tabs.spec.js:736:60

69ed0f0 Run

@ciampo

ciampo commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Before moving to implementation, there are a few things IMO we should discuss:

Do we want / need an ItemGroup equivalent in @wordpress/ui ? Is ItemGroup the right abstraction? Have we considered all the feedback discussed / gathered in #34709 and #64445 ?

Asking because in the past we received feedback about it basically being a glorified list with rounded borders, and I want to make sure we create the right / useful abstractions for our evolved needs; we don't necessarily need to match @wordpress/components

For example, what's the difference between "item group items" and card? Especially for a single-item itemgroup ? Maybe there is potential for integrating this into Card APIs instead?

Also, this feels definitely related to the Settings patterns work, and I feel like it would make sense to agree on components / patterns that we want to endorse in those setting pages before implementing a new component in isolation.

(cc @WordPress/gutenberg-components )

Also:

They’re Emotion-based

This shouldn't be the case, is it just a hallucination or was your agent looking at an old version of the component?

@jasmussen

Copy link
Copy Markdown
Contributor Author

Very valid, and certainly one of the questions I want to press with this PR. For me the answer is yes, given how many places we have bespoke implementations of roughly the same thing, but I'll add question labels to make it clear I like that question. And yes, the emotion stuff could be a hallucination.

@jasmussen jasmussen added Needs Design Feedback Needs general design feedback. Needs Technical Feedback Needs testing from a developer perspective. labels Nov 11, 2026
@jameskoster

Copy link
Copy Markdown
Contributor

We can potentially take inspiration from Item in shadcn/ui, it's very similar to what we need.

ItemGroup could just compose a Stack of Items in a Card.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Related, as I find, this PR closes #64445!

@jasmussen

Copy link
Copy Markdown
Contributor Author

OK, based on the discussion here and the shadcn precedent, I took another stab. I have a local version that is composition-based rather than prop-based, still unpushed. You can try it on the prototype, through the toggle at the top.

The output is identical, but the implementation is not. Instead of one ItemGroup with a lot of props, you compose the row yourself out of named parts. A common row goes from one line of React to six. Both versions are compound components, so “exposing the insides” is not foreign to the system since Card, Menu and Tabs already work this way.

Trade-offs:

  • You can now put a Button inside the navigable row, which isn’t semantic. We can probably guard against that with docs and lint, and to be fair it’s possible in the prop-based version too, since you could add an infotip to a Badge.
  • The focus ring is harder to keep uncropped, because Card applies overflow: clip and clips the outline. I solved it with a negative outline-offset. Honestly I think we should use that more in the project, I still think making the editor footer taller to avoid cropping the focus style was the wrong call. But it’s worth flagging as a trade-off. Compare the two focus styles in the prototype, notably the corner-radius maths get trickier once the ring is inset.

We could decide to accept the Button composition risk, and we could revisit whether Card should clip at all. The benefits of the composition-based version:

  • It’s far more flexible in what you choose to compose. What I built is a hybrid: the row-level navigation stays a prop and the content becomes parts, but it’s much more freeform than before.
  • The group no longer draws its own surface. Card does that, and the group is left with the dividing lines and the list semantics.

So it's more code to maintain, more verbose to use, but more flexible, and each part is simpler on its own. It also seems like the most direct answer to WordPress/gutenberg#64445. I’d rather you all evaluate that than me.

Worth noting that neither version is a candidate for the drag-reordering also mentioned in WordPress/gutenberg#64445, which seems separate, but worth flagging it in case you disagree.

@ciampo

ciampo commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

I like the move to named parts. I'd take it one step further and make Item the component family, with the choice of row telling you what you can interact with. I'd use Item.Link when the whole row takes you somewhere, Item.Button when the whole row runs a command, and Item.Row when the row contains separate controls. For a shadow preset, for example, the name and preview can sit next to Item.Actions with Edit and Remove. Each button gets its own focus target, and clicking the name does nothing.

A single item should work on its own. For a collection, I'd wrap any mix of those three in Item.Group. The group would render a <ul>, with one <li> around each entry. So the same Item.Link renders an <a> on its own and an <li><a>…</a></li> inside a group.

By default I'd join the entries in one frame with dividers. <Item.Group separated> would give each entry its own border and put a gap between them. A standalone group can have a heading above it. Inside a Card, I'd use Card.Title and let the Card supply the outer frame, so the list can sit between a description and other content.

I put those compositions side by side in the interactive prototype. There's a two-column example there too. I'd settle the row and group APIs first and explore layout options separately if we have a use case for them.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Good feedback. I rebuilt locally around your latest prototype and have a model ready to push, which uses this markup:

<Item.Link href="/card">
	<Item.Media><Icon icon={ payment } /></Item.Media>
	<Item.Label>Card payments</Item.Label>
	<Item.Description>Accept cards at checkout.</Item.Description>
	<Item.Meta><Badge intent="stable">Enabled</Badge></Item.Meta>
	<Item.Chevron />
</Item.Link>

You can see the latest model on the prototype, still under the Item tab. One of the consequences worth discussing is the bare item at the bottom:

image

Since the card adds the border, the inner item can now sit alone, "bare", on the canvas. How do we feel about this?

Beyond any feedback, I'd suggest if we do go this direction, for me it would be worth looking at what we can do with the padding. It's the padding that makes it look off.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Another interesting consequence, the separators are now drawn between items, so if you have a card title and description, the top item doesn't have a top border:

image

Probably addressable, so I'm simply surfacing it as part of the exploration here.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Noticed this from GitHub:

image

ciampo and others added 15 commits November 27, 2026 09:25
- Bound the meta column to a quarter of the row and let its value wrap,
  so a long URL no longer pushes the actions out of the row.
- Let rows inherit the density of their group through CSS, so the
  group context carries only the variant.
- Let clicks in the space between two actions reach the row control.
- Warn when an Item.LinkRow has neither an href nor a render prop.
- Track the actions and the chevron in a ref, so mounting actions no
  longer renders the row again.
- Document one Item.Description and one Item.Meta per row.
- Share the render prop helper of Breadcrumb, now in utils.
- Set the ids of the label, description and meta only in link and
  button rows, which reference them. A static row keeps the id the
  consumer passes, so a control in Item.Actions can reference its label.
- Treat an empty aria-labelledby as absent.
- Style a row from its own control, not from a row nested in its
  actions.
- Remove width and height from the Item.Chevron types, which Icon
  ignores, and assert that Item.Media is hidden.
…label

- Treat a whitespace-only aria-label or aria-labelledby as absent, so
  the row control keeps the name from its label.
- Keep an aria-hidden the consumer sets on the label of a static row.
- Document that naming props go on Item.LinkRow, not on its render
  element, so they combine with the references of the row.
- Provide the group variant directly as the group context.
- Hide a group, a static row and actions that have the hidden
  attribute, which their own display would otherwise override.
- Show the label of a disabled row in GrayText in forced colors.
- Pass the naming props of link and button rows straight to the row.
- Name the list in the Item.Group example.
- Remove the hidden rule for the group, static rows and actions. Like
  other @wordpress/ui components, Item sets its own display, so
  consumers hide a row or a part by not rendering it. The usage
  guidelines now say so.
- Use the interactive foreground token for the label of link and
  button rows.
- Reuse the Detached story in the usage guidelines.
- Carry the label color through the heading defense, so a label that
  renders as a heading follows the interactive and disabled colors.
- Leave out the line above a group that is flush with the top of a card,
  where the border of the card already draws one. Card.FullBleed now
  says whether it is flush with the top edge.
…gelog

In a narrow row, the grid gave the meta its full quarter before the
label, so the label broke mid-word. The label now takes at least as
much as the meta can. The layout test uses a control of a fixed width,
so it no longer depends on the fonts of the platform.

Also move the Unreleased sections of the changelog into the order that
the changelog validation expects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Stop supporting a label rendered as a heading in link and button
  rows. The label is hidden from assistive technology there, so the
  heading would not reach it. Document that, and drop the heading color
  bridge and its test.
- Say that a row needs a label unless it has an explicit name, and that
  a detached group goes in `Card.Content` without `Card.FullBleed`.
- Check the exact message in the warning tests.
- Remove a duplicated comment and a stray blank line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A floor on the label column could push wide actions out of a narrow
row, and squeezed the meta to a sliver. The grid cannot make the meta
yield before the label without one of those regressions, so the label
column is flexible again. The layout tests now check what the row
keeps on any platform: the meta stays within a quarter of the row, and
the actions stay inside it, also next to media.

Also say that an explicit name replaces the label, so it should
include the visible label text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show a row that keeps its other actions in a menu, and a collapsible
card with two groups, each named by its own heading. Also say that
`Item.Media` holds no control, so that a drag handle for sorting can
come later as a part of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ard stories

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the shipping, payment gateway and billing examples with general
settings: users, notifications, features, content and export. Payments
stays as one of the connected services.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed [Package] Block editor /packages/block-editor [Package] Edit Site /packages/edit-site [Package] Preferences /packages/preferences [Package] DataViews /packages/dataviews [Package] Boot /packages/boot labels Nov 27, 2026
@ciampo ciampo removed Needs Design Feedback Needs general design feedback. Needs Technical Feedback Needs testing from a developer perspective. labels Nov 27, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
* Components: Alias legacy Item imports as WCItem

Rename every `__experimentalItem` import from `@wordpress/components` to
`WCItem`, ahead of `@wordpress/ui` exporting an `Item` component (WordPress#86676).

The `WCItem` entry in `tools/eslint/components-import-aliases.mjs` lands
with that export: the alias test rejects an alias for a name that does not
collide with a `@wordpress/ui` export yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add DataViews changelog entry for legacy Item aliases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
@poligilad-auto

Copy link
Copy Markdown
Contributor

Hey @jasmussen, great work on this and hoping to use it soon!

In the prototype the icon on the left and the chevron/actions on the right align to the top rather than the middle of the row. With one-line descriptions, like most of these, it feels a little off balance to me. Any particular reason to have it top-aligned?

image image

@ciampo

ciampo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@poligilad-auto I'm not sure how up to date the prototypes are.

This Storybook link reflects the code changes in this PR, and the vertical alignment is centered:

Screenshot 2026-12-03 at 12 03 43 Screenshot 2026-12-03 at 12 03 14

@ciampo

ciampo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Separately, is there anything blocking this PR from shipping? I'd like to wrap this first iteration up soon and iterate as needed.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Yep, Marco took over the PR so the prototypes are now just that, initial prototype explorations, so Marco's link is the one to review.

And on my end, this feels pretty good. Curious what @jameskoster thinks.

@lucyneb

lucyneb commented Dec 3, 2026

Copy link
Copy Markdown

Ohhh it looks so good! I love it, thank you @jasmussen and @ciampo !!! i'll incorporate this into the settings prototype 😊

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] UI Components Impacts or related to the UI component system [Package] UI /packages/ui [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand ItemGroup

5 participants