Repository navigation
Description
Summary
This proposal reframes @wordpress/admin-ui from a loose component library into a focused admin page framework: a small, opinionated surface that encodes WordPress's admin-page design spec as code, so consumers get correct semantics, accessibility, and visual rhythm for free — with no room to drift.
The redesign is a single major bump (@wordpress/admin-ui@2.0) that accepts breaking changes. After 2.0 the package exports exactly one component — <Page> — plus one narrow styling subcomponent, <Page.FullBleed>. Individual UI primitives move to @wordpress/ui; routing, chrome, and cross-tree communication move to consumers as plain props.
Key decisions at a glance
- One public component.
<Page>(with<Page.FullBleed>as a static property). NoBreadcrumbs, noNavigableRegion, noPage.Section, noPageChromeProvider, no slot/fill, no exported type aliases. - Declarative data over JSX. Header content (
badges,breadcrumbs,actions) is typed data. Cardinality rules that can be expressed in the type system (e.g. "≤ 2 secondary actions") are compile-time errors, not runtime warnings.PageActionsis role-shaped:{ primary?, secondary?, overflow? }. - Routing is the consumer's concern. No
@wordpress/routeimport. Breadcrumb items carryhrefand/oronClick; component-based routers plug in via a singlelinkComponentprop. Works for static links, event-based routers, and component-based routers (@wordpress/route, React Router, Next.js) with no admin-ui changes. - Chrome injection is a plain prop.
createSlotFillis dropped; the mobile sidebar toggle is forwarded through aleading?: ReactNodeprop, with a one-lineAppPagewrapper in@wordpress/bootreplacing the current fill pattern. - Correct semantics by default.
<main>landmark,<h1>always present (auto-hidden via<VisuallyHidden>when breadcrumbs are shown, per #76709),aria-current="page"on the last breadcrumb per WAI-ARIA APG,visualalways treated as decorative (aria-hidden), actions wrapped in a labelled group with a spec-ordered primary / secondary / overflow layout. - CSS modules + design tokens. Authored as CSS modules, 100% logical properties, all values sourced from
@wordpress/theme. Drops@wordpress/base-styles. - Responsive header is internal. Container-aware (
ResizeObserver), not viewport-aware: actions overflow to an ellipsis menu, breadcrumbs collapse, the tagline truncates on scroll. No prop surface for it. - Explicit test contract. Unit + integration +
jest-axe+ type tests (tstyche) cover the 10 a11y invariants and every branch of thePageBreadcrumbItemdiscriminated union.
Related issues and PRs
- #76709 — Admin UI: Page header design spec. Source of truth for visual/layout rules encoded by
<Page>in 2.0 (heading visibility when breadcrumbs are present, actions ordering, responsive header behavior, hamburger position). Several open questions in this proposal point at this spec for sign-off. - #77039 — UI: Add
Breadcrumbcomponent (adapted from admin-ui). Prerequisite for admin-ui 2.0 step 4. TheBreadcrumbscomponent moves here, becomes container-aware, and gains the data-first{ href, onClick }shape + optionallinkComponent. - #77040 — Admin UI: Decouple
Pagecomponent from@wordpress/route. Closed by this proposal's §5.3 — routing integration becomes breadcrumb data plus an optionallinkComponent. - #77032 — Admin UI: Move to CSS modules. Subsumed and extended by §8.1 (CSS modules + logical properties +
@wordpress/themetokens + drop@wordpress/base-styles). - #76929 — UI: Update components to use
Text. SameTextusage pattern (variant+render) is what<Page>adopts for title, subtitle, and section heading guidance. - #72106 — NavigableRegion move history. Moved the component into admin-ui (not the other way around), which changes the migration strategy: a new home must be chosen before 2.0 can drop the export. See §2.1 and Q2 below.
- #78881 - Opinionated canvas behaviour for common content types
- #78902 - Supporting footers
Gating open questions
Two items must be resolved before the admin-ui 2.0 implementation lands:
- A11y sign-off on the spec (§6, §9, §6.1). The accessibility contract — single
<main>, auto-hidden<h1>when breadcrumbs are present, decorativevisual, the<main>vs.useNavigateRegionstrade-off — needs review from the WordPress a11y team (e.g. @joedolson). NavigableRegionrehoming (§2.1, §13 Q2). Three options: rehome to@wordpress/interface, rehome to@wordpress/components(lives next touseNavigateRegions), or keep in admin-ui as alock-unlockprivate export. The component itself is not modified.
The remaining open questions in §12 (dev-validation behavior in production, whole-page full-bleed variant, useBreadcrumbLink() helper, deferring navigation / controls in-header slots) can be resolved during implementation without blocking 2.0.
Rollout checklist
- A11y review of §6, §9, §6.1 — sign-off from the a11y team.
- Decide
NavigableRegion's new home (Q2 in §12). - Ship
@wordpress/ui/Breadcrumbper #77039. - Rehome
NavigableRegion; update imports inedit-post,edit-site(×2),interface-skeleton. - Land
@wordpress/admin-ui@2.0.0— export<Page>+<Page.FullBleed>only. - Migrate
@wordpress/bootto anAppPagewrapper that threadsleadingandlinkComponent. - Document breadcrumb → router integration recipes (static, event-based, component-based).
- Update Storybook, regenerate docs.
- Changelog: dedicated Breaking changes section with the full migration table.
Separately tracked, not blocking 2.0:
- Generalize
useNavigateRegionsin@wordpress/componentsto recognize native landmarks. Lets admin pages (and everything else) drop the customNavigableRegionidiom over time.
Full plan (click to expand)
1. Product vision
@wordpress/admin-ui is not a component library. It is an admin page framework: a small set of opinionated, high-level building blocks that encode WordPress's admin page design spec as code.
The mental model should be:
| Layer | Purpose | Flexibility | Example |
|---|---|---|---|
@wordpress/theme |
Design tokens (spacing, color, type, radius). | — | --wp-space-300 |
@wordpress/ui |
Low-level generic UI primitives (Stack, Button, Badge, Text, Card.FullBleed, etc.). |
High | <Text>, <Badge> |
@wordpress/admin-ui |
Page-level composition that bakes in the admin spec. | Low | <Page>, <Page.FullBleed> |
| Consumers (boot, etc.) | Wire up routing, data, chrome. | — | <Root>, <Outlet> |
Key principle: admin-ui hides decisions, @wordpress/ui exposes them. If a consumer wants full control over a breadcrumb rendering they reach for @wordpress/ui. If they want "the WordPress admin page header, done right", they reach for @wordpress/admin-ui.
This reframing drives every decision below.
2. Scope — what belongs, what does not
2.1 Does not belong
-
Breadcrumbs→ move to@wordpress/uias a generic, container-aware, routing-agnostic primitive (see §5 and UI: Add Breadcrumb component (adapted from admin-ui) #77039).admin-uiaccepts breadcrumbs as data, it does not implement breadcrumbs. -
NavigableRegion→ drop from the admin-ui public API. Needs a pre-2.0 decision: PR #72106 (Oct 2025) moved the component out of@wordpress/interfaceinto@wordpress/admin-uiand deleted the interface copy, so admin-ui's version is the canonical implementation. The four consumers —edit-post/components/layout,edit-site/components/layout,edit-site/components/save-panel,interface/components/interface-skeleton— import it from here. (The source comment referencing@wordpress/editoris stale.)Consequence: no "original" private API exists to migrate back to. Before
admin-ui@2.0can drop the export,NavigableRegionneeds a new home. Options (decision required — see §12 Q2):- Rehome to
@wordpress/interface. Natural owner giveninterface-skeletonis the heaviest user. No API change; callers update import paths. - Rehome to
@wordpress/componentsalongsideuseNavigateRegions. Architecturally clean — the region primitive and the cycling hook live together — but bloats a public package. - Keep in admin-ui, drop from public exports. Export as a private API via
lock-unlock. Contradicts the "admin-ui drops responsibility for individual UI components" principle (§1); included for completeness.
Whichever option is chosen,
NavigableRegionitself is not modified by this work; it moves as-is. - Rehome to
-
Slot/Fill infrastructure → drop.
createSlotFillis only used today for the mobile sidebar toggle, which is solvable with a plain prop plus a consumer-side wrapper component (§7).createSlotFillstays where it is (in@wordpress/components); it is not moved to@wordpress/ui. -
Direct
@wordpress/routedependency → drop. Routing is a concern of the consumer (§5.3 and Admin UI: Decouple Page component from@wordpress/route#77040).
2.2 Belongs
- Page shell (
<Page>) — landmarks, heading hierarchy, header content, padded content area by default (§4.3). - Full-bleed escape (
<Page.FullBleed>) — opt-out wrapper that lets a specific content block span the full page width, bypassing the default inline padding (§4.3.a).
Everything else that a "package for admin pages" might plausibly own is explicitly not in scope for 2.0: router integration is handled by breadcrumb data plus an optional linkComponent prop (§5.3), chrome injection is a plain prop (§4.5), and cross-tree communication is the consumer's concern (not admin-ui's). Patterns for list views or split/detail layouts may land in later minors without breaking changes — not part of the initial surface.
Anything that is not specific to admin pages does not belong here.
3. API strategy — decision
Options considered:
| Strategy | Strength | Weakness for admin-ui |
|---|---|---|
| Monolithic props (current) | Easiest to type. | Prop soup (title, subTitle, visual, badges, actions, breadcrumbs, headingLevel, hasPadding …). And constraints that should be enforced at compile time (e.g. "≤ 2 secondary actions") degrade to runtime warnings when the prop is a flat list. |
Compound components (<Page.Header>, <Page.Title>, …) |
Ergonomic, composable. | Too permissive. Consumers can re-order, duplicate or omit parts, defeating the point of an inflexible spec. |
| Render/slot props with typed contracts | Allows structured content plus runtime validation. | Awkward when only one slot varies; boilerplate; types can't always express "string-or-one-of-a-set-of-ReactNodes". |
| Declarative data + a few named slots, no exposed compound parts | Strongest fit with the product vision: opinionated, precise. | Slightly less "React-idiomatic". But we want less idiom here — we want a spec. Data is easy to validate and lint. |
Decision: declarative configuration, with a minimal, named slot surface.
- The shape of the header is data, not JSX. Where a cardinality rule can be expressed in the type system — e.g. "at most one primary action, at most two secondary actions" as a tuple union on
PageActions(§4.3) — it is type-enforced, not runtime-validated. Runtime validation only covers what types can't, such as breadcrumb items that provide neitherhrefnoronClick. - One narrow styling subcomponent is publicly exposed:
<Page.FullBleed>(§4.3.a). It is a styling wrapper, not a structural compound part, and earns the exception for the reasons spelled out below. No other compound sub-components (<Page.Header>,<Page.Title>,<Page.Section>, …) are exposed. Internally<Page>composes a private<Header>; that composition is not part of the API surface. - Two tight escape hatches for content that cannot reasonably be data:
visual(a decorativeReactNode) andleading(app-shell chrome, §4.5). - Runtime validation (dev-only) catches the few things types can't: breadcrumb items missing both
hrefandonClick, etc. Cardinality rules that can be expressed in the type system (actions shape) are enforced at compile time — see §4.3.
This gives us the ergonomics of named fields + the safety of a schema.
4. Proposed public API
4.1 Exports (complete)
// packages/admin-ui/src/index.ts
export { Page } from './page';
// <Page.FullBleed> is attached as a static property of Page (see §4.3.a).One component (plus Page.FullBleed as a static subcomponent). No Breadcrumbs, no NavigableRegion, no slot/fill, no Page.Section, no PageContent, no PageChromeProvider / usePageChrome, and no exported type aliases. Consumers that need a prop type use React.ComponentProps<typeof Page>; keeping named types out of the public surface shrinks the API we have to maintain and version.
Router integration is expressed as data on breadcrumb items, with an optional linkComponent prop for consumers who want their router's Link to render the markup (§5.3). Chrome injection is a plain prop on <Page> (§4.5). Padding is the default, with <Page.FullBleed> as the opt-out (§4.3.a).
4.2 <Page>
<Page
// Required semantic identity
title="Pages"
// Optional header content
subtitle="Manage static site pages"
visual={ <Icon icon={ pages } /> /* see §4.3, always decorative */ }
badges={ [ { label: 'Beta', intent: 'informational' } ] }
breadcrumbs={ [
{ label: 'Dashboard', href: '/' },
{ label: 'Content' },
] }
actions={ {
primary: { label: 'Add new', onClick: onAddNew },
secondary: [
{ label: 'Import', onClick: onImport },
],
overflow: [
{ label: 'Export all', onClick: onExport },
{ label: 'Delete all', onClick: onDeleteAll, isDestructive: true },
],
} }
// App-shell injection slot (§4.5)
leading={ /* e.g. mobile sidebar toggle */ }
// Optional: render breadcrumb links with a custom component, e.g. a router Link (§5.3)
linkComponent={ RouteLink }
// Ref to the <main> landmark (§6.1), plus standard HTML pass-through
ref={ pageRef }
className="my-route-page"
id="pages-route"
>
<h2>Recent</h2>
<Summary />
<Page.FullBleed>
<DataViewsTable />
</Page.FullBleed>
</Page><Page> is the only component that encodes admin-page semantics. There are no publicly exposed structural compound sub-components — see §4.4 for why <Page.Section> was considered and dropped.
<Page> is forwardRef-ed to the <main> landmark (§6.1). It accepts className, id, and ref as standard pass-throughs; no other HTML attribute pass-through is supported so the component can evolve its internal markup without leaking.
4.3 Props, typed primitives, and runtime validation
Prop types of <Page> (shown for documentation; not exported):
type PageProps = {
// Required
title: string;
// Optional text / layout — "subtitle" maps to the design spec's "Tagline" (short page summary)
subtitle?: string;
// Header slots
visual?: React.ReactNode; // always decorative — see below
leading?: React.ReactNode; // §4.5
// Header data
badges?: ReadonlyArray< PageBadge >;
breadcrumbs?: ReadonlyArray< PageBreadcrumbItem >;
actions?: PageActions;
// Router integration (§5.3)
linkComponent?: BreadcrumbLinkComponent;
// Content
children?: React.ReactNode;
// Standard HTML pass-through
className?: string;
id?: string;
};
type PageBreadcrumbItem =
// Link: may also attach an onClick for SPA interception (§5.3).
| {
label: string;
href: string;
onClick?: ( event: React.MouseEvent< HTMLElement > ) => void;
}
// Non-URL action (not a link — rendered as a <button>).
| {
label: string;
onClick: ( event: React.MouseEvent< HTMLElement > ) => void;
}
// Current / non-interactive item.
| { label: string };
type PageBadge = {
label: string;
intent?: 'informational' | 'success' | 'warning' | 'critical';
}; // non-interactive; for interactive status use `actions`
// Actions shape encodes the spec's roles (#76709):
// - exactly 0 or 1 primary (always rendered right-aligned);
// - 0, 1, or 2 secondary buttons (cap enforced by the tuple union below);
// - any number of overflow actions, rendered as items inside an ellipsis menu admin-ui owns.
type PageActions = {
primary?: PageAction;
secondary?:
| readonly [ PageAction ]
| readonly [ PageAction, PageAction ];
overflow?: ReadonlyArray< PageAction >;
};
// Shared shape for all three roles. The event target is `HTMLElement` because overflow
// items render as menu items, not `<button>`s. The final mapping onto @wordpress/ui's
// `<Button>` / menu-item surface (leading-icon vs. icon-only, disabled semantics) is
// a small integration task, not a shape decision for admin-ui.
type PageAction = {
label: string;
onClick: ( event: React.MouseEvent< HTMLElement > ) => void;
icon?: React.ReactNode;
isDisabled?: boolean;
isDestructive?: boolean; // visual treatment; not a semantic confirmation flow
};
// Optional escape hatch for component-based routers (§5.3).
type BreadcrumbLinkComponent = React.ComponentType< {
href: string;
children: React.ReactNode;
onClick?: ( event: React.MouseEvent< HTMLElement > ) => void;
className?: string;
} >;Observations:
titleis required.<Page>derives its accessible name from the<h1>viaaria-labelledby; there is noariaLabelprop.- No
hideTitleprop. The spec (Admin UI: Page header design spec #76709) defines the rule: "when breadcrumbs are shown, the page title should be hidden (but still present) to avoid visually duplicating page info".<Page>implements that rule automatically — ifbreadcrumbsis non-empty, the<h1>is wrapped in<VisuallyHidden>(kept in the DOM foraria-labelledby); otherwise it renders visibly. Consumers make no decision. breadcrumbsis data, not<Breadcrumbs>JSX.<Page>renders the primitive from@wordpress/uiinternally. That is how routing becomes pluggable (§5.3).actionsis role-shaped, not a flat list.primaryis a single object (never multiple),secondaryis a tuple capped at two elements by the type itself, andoverflowis the ellipsis-menu bucket. The spec's rules (Admin UI: Page header design spec #76709 — 1 primary, ≤ 2 secondary, tertiary behind an ellipsis menu) are expressed at the type level and cannot be violated without a compile error; runtime validation has nothing to enforce on this front. Ordering is owned by admin-ui per the spec ("primary button is always positioned to the right"); consumers do not author order.overflowitems are rendered as menu items inside an ellipsis-menu button admin-ui emits. Admin-ui owns the menu's ARIA (aria-haspopup="menu", keyboard behavior, focus return). Consumers do not supply the menu or its trigger.PageActionis shared across all three roles. The final visual mapping onto@wordpress/ui's<Button>/ menu-item surface (leading-icon vs. icon-only, disabled semantics, destructive styling) is a small integration task; none of it changes the admin-ui prop shape.visualis a plainReact.ReactNodeand is always decorative: admin-ui renders it inside a wrapper witharia-hidden="true". Informative imagery belongs in the content area with its ownalttext, not in the page-title visual slot. This keeps the header's accessible name exactly the title. Consumers pass whatever they like —<Icon icon={…} />, an<img alt="">, an emoji, nothing.- No free-form
headingLevelprop.<Page>is alwaysh1. Content-area headings are the consumer's responsibility and should useh2for top-level blocks (see §4.4 and §6). - No
density,size, orpaddingprops. All considered and rejected as speculative: admin pages use one canonical density and layout from the design system, padding defaults to on with<Page.FullBleed>(§4.3.a) as the only escape. Any of these can be added later with an explicit, spec-backed value if a real need appears. - Responsive header behavior is internal, not configurable.
<Page>implements the spec's responsive rules (actions overflowing to the ellipsis menu, breadcrumb collapsing, tagline truncation on scroll, hamburger revealing at the mobile breakpoint) viaResizeObserveron the page header — container-aware, not viewport-aware. No prop opts in or out.
Runtime validation (dev-only):
if ( process.env.NODE_ENV !== 'production' ) {
assertPagePropsValid( props );
}Rules enforced:
breadcrumbs: all but the last must havehreforonClick.- (Actions cardinality rules are type-enforced via
PageActions, not runtime-validated.)
Errors are thrown in development; silent in production (see §13).
4.3.a Padding: default + <Page.FullBleed> escape
<Page> applies the canonical admin-page inline padding by default — header and content use the same value from @wordpress/theme. No prop is required. Most admin pages want this and should not have to think about it.
For the specific case where a single content block needs to span the full page width (the canonical example is a DataViews-style list/table that aligns with the outer container), consumers wrap that block in <Page.FullBleed>:
<Page title="Pages">
<h2>Recent</h2>
<Summary />
<Page.FullBleed>
<DataViewsTable />
</Page.FullBleed>
<Footer />
</Page>-
<Page.FullBleed>neutralizes the page's inline padding for its children — typically via negative inline margins sized from the same token the page uses, so the two cannot drift. -
Accepts all standard
<div>props (className,id,style,role,aria-*, data attributes,children, …).refis forwarded to the underlying<div>. No admin-ui-specific knobs (no size, no variant) — the only thing this component does is neutralize the page's inline padding.type PageFullBleedProps = React.ComponentPropsWithRef< 'div' >;
-
Valid only inside
<Page>(nothing outside<Page>has a padding to neutralize). This is stated in the docs; no runtime dev warning is shipped in 2.0. If misuse shows up in practice, a warning can be added later without an API change.
Pattern precedent: Card.FullBleed in @wordpress/ui (packages/ui/src/card/full-bleed.tsx). Contributors already know the semantics.
Why no padding prop up front: the default is correct for most pages; a two-value prop forces every consumer to decide and encodes a bet about which cases exist. <Page.FullBleed> inverts the default at the exact content-tree location where the decision is made. Padded header + full-bleed table is a recognized admin UI pattern (Notion, Linear, GitHub settings, WP admin). If a whole-page full-bleed variant ever becomes a real need, we add a prop then with a spec-backed value.
On the compound-component trade-off: §3 rejects compound patterns as too permissive. <Page.FullBleed> earns the pattern anyway because it's a styling wrapper, not a structural component — one narrow, named affordance ("this block is full-bleed"), namespaced to telegraph the "only valid inside <Page>" constraint. <Page.Section> failed because it was both too weak (enforced little) and too opinionated (fixed title shape); <Page.FullBleed> is strong (neutralizes a specific rule) and opinionless about content.
4.4 No <Page.Section> — and why
A <Page.Section> component was considered and rejected. It would have:
- Wrapped children in
<section aria-labelledby={generatedId}>. - Generated the id and rendered an
<h2 id={generatedId}>{title}</h2>. - Enforced
h2for section headings. - Applied some vertical rhythm.
Each is weak in practice:
- (1)–(2) are three lines of consumer JSX; the
aria-labelledbywiring is documented in the README. - (3) is enforced by the API, not by the DOM — a consumer who puts
<h3>inside still ships<h3>. Lint / axe catch this regardless. - (4) is styling, cleaner on the page-content wrapper.
- The title shape is inflexible. Real admin-page sections combine title + description + action + status + icon in ways that vary by page type; a fixed shape is wrong for most, and a permissive shape starts replicating
<Page>'s header at a smaller scale.
Consequence: admin-ui does not ship <Page.Section>. Content inside <Page> uses <section aria-labelledby> where appropriate, composed from @wordpress/ui primitives. Validated by a11y tests (§9, §10). If practice shows a common shape emerging, we revisit — not before.
4.5 leading — the one chrome injection point
App shells sometimes need to decorate every page's header with a piece of chrome that the page itself does not know about — the canonical example is boot's mobile sidebar toggle. <Page> accommodates this with a single plain prop:
leading?: React.ReactNode;-
Rendered in the header row, as the leading item before the visual / title cluster. This hypothesis mirrors where today's
SidebarToggleSlotsits inpackages/admin-ui/src/page/header.tsx, so existing integrations carry over without visual change. -
Design feedback still required. Admin UI: Page header design spec #76709 illustrates the hamburger appearing at a specific mobile breakpoint; the final position (in-row vs. on its own line above the breadcrumbs, size/alignment, responsive behavior) should be confirmed by design before we freeze the spec. Adjusting the internal render location is not a breaking change; the prop itself is stable.
-
A plain
ReactNode, not a render prop (nothing about the rendering is dynamic per-invocation) and not a slot/fill or context (both add DI infrastructure the package does not need). -
Admin-ui does not ship a provider for this. If a shell wants every page to receive the same node, it defines a one-line wrapper:
// boot: const AppPage = ( props ) => ( <Page leading={ isMobileViewport ? <MobileSidebarToggle /> : undefined } { ...props } /> );
Routes render
<AppPage>instead of<Page>. That wrapper is boot's concern, not admin-ui's.
4.6 No PageChromeProvider / context / slot-fill / render-prop functions
Admin-ui ships no public DI infrastructure — no slot/fill, no exported context, no provider, no hook, no render-prop functions. leading is a plain ReactNode prop (§4.5); router integration uses breadcrumb item data (href, onClick) plus an optional linkComponent component type (§5.3). The "one place, many pages" case is handled by a consumer wrapper component (§11 — e.g. boot's AppPage), not a provider.
5. Decoupling: components, routing, breadcrumbs
5.1 Drop @wordpress/components; consolidate on @wordpress/ui
Current admin-ui imports from @wordpress/components are replaced entirely:
| Current | Replacement |
|---|---|
__experimentalHeading (inside the Breadcrumbs) |
Removed. @wordpress/ui/Breadcrumb no longer renders a heading (§5.2). <Page>'s own <h1> is a native heading, styled with <Text render={ <h1 /> } /> from @wordpress/ui. |
__experimentalHStack / HStack |
<Stack direction="row"> from @wordpress/ui. |
createSlotFill (sidebar toggle) |
Plain leading prop on <Page> (§4.5). |
SlotFillProvider in consumers |
No longer needed for admin-ui (consumers may still use it for their own reasons). |
Badge for PageBadge |
<Badge> from @wordpress/ui. |
@wordpress/ui component catalog actually used by admin-ui 2.0 (verified against packages/ui/src/index.ts):
| Component | Exists in @wordpress/ui today? |
Used for |
|---|---|---|
Stack |
yes | header layout |
Text |
yes (with variant + render) |
title, subtitle, section headings |
Badge |
yes | PageBadge |
Button |
yes | PageAction |
Icon |
yes | icons inside visual / action buttons |
VisuallyHidden |
yes | hiding the <h1> when breadcrumbs are set |
Breadcrumb |
no (#77039) | new component, ships before admin-ui 2.0 |
Card.FullBleed exists in @wordpress/ui (packages/ui/src/card/full-bleed.tsx) and is not consumed by admin-ui. It is referenced separately in §4.3.a as pattern precedent and naming/semantics source for <Page.FullBleed>. No runtime dependency.
After this, admin-ui depends on @wordpress/ui, @wordpress/theme, @wordpress/i18n, clsx — and nothing else from the components ecosystem. Where no @wordpress/ui component fits (e.g. custom layout rules for the header grid), we write plain CSS with design tokens from @wordpress/theme. No ad-hoc values.
All user-facing strings (accessible labels, dev-validation messages shown in UI) are marked for translation with __() / _x() from @wordpress/i18n. Nothing is hard-coded English.
5.2 Move Breadcrumbs to @wordpress/ui (container-aware, router-agnostic)
This is #77039. Concrete shape of the new @wordpress/ui/Breadcrumb:
-
Container-aware via
ResizeObserver. When the available inline size drops below a measured threshold, items collapse to an overflow menu (middle items first, keeping the root and the current). Not tied to viewport media queries. -
Data-first, opt-in component rendering. Items carry
hrefand/oronClickdirectly. The component renders:hrefonly, nolinkComponent→<a href>(static link).href+onClick, nolinkComponent→<a href onClick>(SPA link; consumerpreventDefaults if they want to intercept).href+linkComponent→ renders the consumer's component, passing{ href, children, onClick?, className? }.onClickonly →<button type="button" onClick>(non-URL action).linkComponentdoes not apply to buttons.- Neither → non-interactive text with
aria-current="page"(the current item).
There is no provider and no function render-prop. The integration point is a single optional
linkComponent: React.ComponentType<…>on the container (<Page>in admin-ui's case,<Breadcrumb>in@wordpress/ui). -
Accessibility:
<nav aria-label={ translated 'Breadcrumb' }>,<ol>,aria-current="page"on the last item regardless of whether that item is a link, a button, or plain text (per WAI-ARIA Authoring Practices – Breadcrumb). Proper collapsed-menu ARIA for the overflow state. -
External breadcrumb links are out of scope. Breadcrumbs represent the hierarchy of the current admin surface; they are assumed internal.
target,rel, anddownloadare not part of the contract. Consumers that need external links in navigation use regular<a>elements outside the breadcrumb component. -
Does not own the page
h1(the current admin-ui Breadcrumbs does, which is wrong — it only makes sense because the component lives inside a Page header; the primitive must not make that assumption).
Admin-ui consumes this primitive internally for its breadcrumbs prop and renders the h1 separately and unconditionally.
5.3 Decouple from @wordpress/route (#77040): data + linkComponent
@wordpress/admin-ui has no import from @wordpress/route. <Page> exposes two integration surfaces, both plain props:
- Breadcrumb item data (
href,onClick) — for the common case where the item is a static URL, an SPA link with click interception, or a non-URL action. linkComponent?— a single optional React component type that admin-ui uses to render items withhref. Lets consumers plug in their router's<Link>when they want the extras it provides (prefetching, active state, client-side routing semantics).
The fixed contract for linkComponent:
type BreadcrumbLinkComponent = React.ComponentType< {
href: string;
children: React.ReactNode;
onClick?: ( event: React.MouseEvent< HTMLElement > ) => void;
className?: string;
} >;href is always passed to linkComponent (admin-ui normalizes the shape regardless of what a given router's component uses internally). Routers whose Link uses a different prop name are adapted at the call site with a one-line component. No consumer ever imports from @wordpress/ui to wire routing.
How each router pattern integrates:
Static <a href> (no JS routing). Just set href, don't pass linkComponent:
breadcrumbs={ [
{ label: 'Dashboard', href: '/wp-admin/' },
{ label: 'Pages', href: '/wp-admin/edit.php?post_type=page' },
{ label: 'Edit' },
] }Event-based / imperative router (exposes navigate(url), no Link component). Attach navigation in onClick; keep href so the link still works without JS and so middle/cmd-click still open the target via the browser default:
breadcrumbs={ [
{
label: 'Dashboard',
href: '/',
onClick: ( event ) => {
event.preventDefault();
router.navigate( '/' );
},
},
{ label: 'Pages' },
] }(Whether to defer to the browser on modifier / middle clicks is a consumer decision and out of scope for admin-ui. <Page> simply forwards the event.)
Component-based router (@wordpress/route, React Router, etc. — Link uses to). Define a one-line adapter in the shell and pass it once via linkComponent:
import { Link } from '@wordpress/route';
const RouteLink = ( { href, children, ...rest } ) => (
<Link to={ href } { ...rest }>{ children }</Link>
);
<Page breadcrumbs={ [ … ] } linkComponent={ RouteLink } />(Routers with strictly-typed route tables — TanStack, React Router v6 type-safe mode — may require a typed cast in the adapter; that's a one-time shell concern, not a per-page one.)
Component-based router whose Link already uses href (Next.js et al.): pass the component directly.
5.4 Reducing repetition: the AppPage wrapper threads both props
Both leading (§4.5) and linkComponent are configured identically by the app shell — once, in a thin AppPage wrapper — so consumer route pages never touch either:
// boot/app-page.tsx
import { Page } from '@wordpress/admin-ui';
import { Link } from '@wordpress/route';
const RouteLink = ( { href, children, ...rest } ) => (
<Link to={ href } { ...rest }>{ children }</Link>
);
export const AppPage = ( props: React.ComponentProps< typeof Page > ) => (
<Page
leading={ isMobileViewport ? <MobileSidebarToggle /> : undefined }
linkComponent={ RouteLink }
{ ...props }
/>
);Route pages — including third-party plugins inside boot — render <AppPage> and get both shell chrome and router integration for free. Pages outside boot render <Page> and choose what (if anything) to pass; they will not participate in boot's chrome, which is the intended boundary.
5.5 Why linkComponent over a provider or function render-prop
Consumers don't import from sibling packages or configure providers to wire routing. Event-based routers and static links work out of the box; component-based routers plug in via a one-line adapter — a component type, not a render-prop function, so it composes with React.memo. Progressive enhancement comes for free: href is a real URL and works without JS; onClick is a pure enhancement.
This closes #77040 (no router code in admin-ui), keeps the consumer's dependency surface on admin-ui only, and supports event-based and component-based routers equally well.
6. Document hierarchy & semantics (non-negotiable)
Pending a11y review. The defaults below are our proposal; before finalizing, the spec needs sign-off from WordPress a11y reviewers (e.g. Joe Dolson and the a11y team). The
<main>vs.useNavigateRegionsdecision in §6.1 is the most likely item to warrant discussion.
<Page> is responsible for a correct, predictable document skeleton. This is the main reason the package exists.
Baseline output (labels shown in English for readability; all are translated with __() / _x() from @wordpress/i18n). The readable suffixes on class="[hashed] …" are there to help the reader identify each element — the actual output is hashed class names only, per §8.1:
<main class="[hashed]" aria-labelledby="[generated-page-title-id]">
<header class="[hashed]">
<nav aria-label="Breadcrumb">...</nav>
<div class="[hashed] header-row">
<!-- `leading` renders as the leading item of the header row (hypothesis from §4.5; pending design sign-off on #76709). -->
<div class="[hashed] leading">...</div>
<div class="[hashed] visual" aria-hidden="true">...</div>
<h1 id="[generated-page-title-id]">Pages</h1>
<!-- Badges rendered adjacent to the title, not as part of it. Non-interactive. -->
</div>
<!-- Subtitle uses `<Text render={ <p /> } />` from @wordpress/ui (spec calls this the "Tagline"). The exact variant is chosen from the design tokens / spec — do not hard-code. -->
<p class="[hashed] subtitle">Manage static site pages</p>
<!--
Actions group. Label is a generic, fixed, translated string.
Order of children is fixed by admin-ui, not by the consumer:
secondary buttons → (ellipsis menu, if `overflow` is non-empty) → primary button (right-aligned per #76709).
The ellipsis button is labelled "More actions" (translated); opening it reveals a role="menu" with the overflow items.
-->
<div class="[hashed] actions" role="group" aria-label="Actions">
<button>Import</button>
<button aria-haspopup="menu" aria-expanded="false" aria-label="More actions">...</button>
<button class="[hashed] primary">Add new</button>
</div>
</header>
<!-- Consumer-authored content. Inline padding is the admin-page default; <Page.FullBleed> neutralizes it per-block. -->
<div class="[hashed] content">
<!-- Sections, if used, are <section aria-labelledby> with <h2>. -->
</div>
</main>Rules the component guarantees:
- The page landmark is
<main>, not a genericregion. There is exactly one<main>per rendered<Page>. - The page title is always
<h1>. Whenbreadcrumbsis non-empty the<h1>is wrapped in<VisuallyHidden>(per Admin UI: Page header design spec #76709: "when breadcrumbs are shown, the page title should be hidden but still present"). It remains in the DOM soaria-labelledbyand AT navigation still work; only the visible rendering is suppressed. No consumer-facing prop controls this. - The visual element is always decorative — admin-ui wraps it with
aria-hidden="true"unconditionally. Informative imagery belongs in the content area. - Badges sit alongside the title but outside the
<h1>(current behavior is sometimes inside the heading — confusing for AT) and are non-interactive. - Actions are wrapped in a group labelled "Actions" (generic, fixed, translated).
- The header responds to its container size (
ResizeObserver, not viewport media queries): actions overflow to the ellipsis menu, breadcrumbs collapse to a middle-truncated form, the tagline truncates on scroll, and the hamburger (leading) reveals at the mobile breakpoint per Admin UI: Page header design spec #76709. This is internal behavior; no prop configures it.
Rules documented for consumer-authored content (enforced by tests, not by a component):
- Top-level content blocks should be
<section aria-labelledby={id}>with an<h2 id={id}>. From@wordpress/ui,<Text render={ <h2 /> }>(with the heading variant chosen from the design spec) is the canonical primitive. - Heading order is monotonic: no
<h3>without a preceding<h2>; no level skipping. - Inline padding is the admin-page default, applied by
<Page>. Blocks that need full width use<Page.FullBleed>(§4.3.a). Content-specific spacing inside the page uses@wordpress/themetokens, not hard-coded values.
6.1 <main> vs. useNavigateRegions — explicit trade-off
<Page> renders a plain <main>. It does not add role="region" or tabIndex="-1", and therefore does not participate in the useNavigateRegions (@wordpress/components) cycle by default.
Why:
useNavigateRegionsmatches a hard-coded selector:[role="region"][tabindex="-1"]. It does not recognize native landmarks (<main>,<nav>,<aside>, …).- Adding
role="region"to<main>overrides the implicitmainrole (author role wins), downgrading the landmark to a generic named region. We want to keep the strongest landmark. - Nesting (
<main><section role="region" tabindex="-1">) reintroduces theNavigableRegion-style wrapper we are deleting. tabIndex="-1"only matters for programmatic focus. Route-change focus management is a consumer concern, not a<Page>concern.<Page>forwards arefto its<main>element so consumers that need to call.focus()on route changes can do so.
Consequence: the existing NavigableRegion instances in editor chrome (interface-skeleton emits them for header, sidebars, content, actions, footer; edit-post / edit-site / save-panel add more) keep cycling under Ctrl+` / Alt+Shift+N,P. The cycle simply does not include the admin page itself. This matches the spirit of the hook — it's most useful for moving within chrome, not for picking the page. (Wherever NavigableRegion is rehomed per §2.1 and §13 Q2, it continues to work unchanged.)
Follow-up (separate task, @wordpress/components): generalize useNavigateRegions to recognize native landmarks (main, nav, aside, labelled section, …) and handle focus on elements without a pre-set tabindex (either by setting it imperatively before .focus() or by using { preventScroll: true } and tolerating the focus-outline story). This unlocks "use real landmarks" codebase-wide, not just in admin-ui, and removes the custom NavigableRegion idiom over time. Tracked separately from the admin-ui 2.0 work; a11y review should confirm the approach before we implement.
(If it turns out admin pages genuinely need to participate in the cycle before the useNavigateRegions generalization lands, the fix is implemented there — inside @wordpress/components — not by adding a prop to <Page>. This keeps admin-ui's API spec-backed rather than an accumulation of toggles.)
7. Retiring createSlotFill without replacing it with DI
Today: Page.SidebarToggleFill in <Root> teleports a button into <SidebarToggleSlot> via @wordpress/components slot/fill + SlotFillProvider. The replacement:
<Page>exposes one plainReactNodeprop,leading, for header chrome (§4.5).- The app shell (
boot) defines a one-lineAppPagewrapper that forwards state-driven chrome to<Page>asleading. - Route components render
<AppPage>instead of<Page>. APageChromeProvidercontext was considered and rejected: an ancestor→descendant DI step is handled better outside admin-ui, by a wrapper component in the shell.
After migration:
// boot/app-page.tsx
export const AppPage = ( props ) => (
<Page
leading={ isMobileViewport ? <MobileSidebarToggle /> : undefined }
{ ...props }
/>
);
// route page
<AppPage title="…">…</AppPage>(Page.SidebarToggleFill + SlotFillProvider go away on both sides.)
Benefits over slot/fill and context: no DI infrastructure shipped by admin-ui, no SlotFillProvider required by consumers for this feature, every integration point on <Page> is a plain prop with an obvious call stack (easier to reason about in tests, Storybook, SSR), and the shell is explicit about what it decorates pages with in exactly one place (AppPage).
Nesting <Page> (two landmarks on one screen) is unsupported — it violates the "exactly one <main>" invariant in §9. Route-level modals should render a role="dialog" with their own header, not another <Page>.
8. Styling & build
8.1 CSS modules, logical properties, tokens
- All styles are authored as CSS modules (
*.module.scssor*.module.css), colocated with components. No global selectors like.admin-ui-pagein the authored CSS; consumers get hashed class names and can't accidentally override internals. (Design-token references such asvar(--wp-space-300)and semantic custom properties set at the Page root remain global — custom properties are intentionally global.) - 100% logical properties (
padding-block,margin-inline-start,inset-inline-end). This is already partially true and must be enforced via a stylelint rule (@wordpress/stylelint-config's logical-props rule or equivalent). - All spacing, color, type, radius values come from
@wordpress/themetokens. No hard-coded24px, no raw#fff. If a value is used that has no theme-token equivalent, file a gap on@wordpress/themerather than inlining a literal. - A few semantic CSS custom properties at the Page level (
--admin-ui-page-padding-inline) so<Page.FullBleed>can reference the exact same value for its negative margin. @wordpress/base-stylesdependency: removed. If a utility is needed, pull the token from@wordpress/theme; otherwise write the few lines of plain CSS.
Supersedes / subsumes #77032.
8.2 package.json hygiene
{
"name": "@wordpress/admin-ui",
"sideEffects": [
"**/*.css",
"**/*.scss"
],
"files": [
"build",
"build-module",
"build-style",
"build-types",
"CHANGELOG.md",
"README.md"
],
"exports": {
".": { "types": "./build-types/index.d.ts", "import": "./build-module/index.mjs", "require": "./build/index.cjs" },
"./style": "./build-style/style.css",
"./package.json": "./package.json"
}
}Changes vs. today:
sideEffectspatterns cover built and source stylesheets (**/*.csscatches CSS-modules output). The current"src/**/*.scss"only makes sense when consumers import source, which they should not.srcis removed fromfiles(we do not ship source). Drop"react-native": "src/index"unless there is an actual RN consumer; if there is, we need a dedicated build, not a source re-export../styleexport is explicit. Stylesheet shipping becomes a documented choice instead of an implicit side effect.
8.3 Build
- TypeScript strict,
noUncheckedIndexedAccessenabled. - No
anyin the admin-ui source (NavigableRegionis removed from admin-ui and, per §2.1, is not modified as part of this work). - ESM-first; CJS kept while monorepo requires it.
9. Accessibility requirements (explicit contract)
Captured here as testable invariants:
- Exactly one
<main>per<Page>render. - Exactly one
<h1>emitted by<Page>per render, carrying the accessible name fromtitle. Whenbreadcrumbsis non-empty, the<h1>is visually hidden (via<VisuallyHidden>) but remains in the DOM with the same accessible name. Consumer-authored<h1>s inside content are a consumer concern and are flagged by axe, not by<Page>. aria-current="page"on the last breadcrumb item, regardless of how it is rendered (per WAI-ARIA APG).- The
visualslot is always wrapped inaria-hidden="true"and rendered outside the heading. - Actions group has a fixed, translated accessible label ("Actions").
- All interactive header elements have visible and programmatic names (enforced by axe in tests).
- Color contrast tested against the current
@wordpress/themepalette in light and dark. - Tab order follows DOM order: breadcrumbs →
leading→ header actions → content. (Per the §6 baseline HTML,<nav aria-label="Breadcrumb">is a sibling above the title row, andleadingsits inside the title row before the visual/title cluster.) The<h1>is non-interactive and is skipped, as expected. - Reduced-motion honored for any internal transitions (currently none; keep it that way).
- Heading order inside
<Page>content is monotonic (no skipped levels). Validated by axe in the integration tests against a representative content fixture; consumer-authored content is otherwise their responsibility.
Each item is backed by unit tests (§10).
10. Testing plan
The package ships with:
- Unit tests (RTL + jest-axe) — one test file per component, covering:
- Invariants 1–10 from §9.
- Dev-validation errors (correct messages, only thrown in dev).
leadingrenders in the header; absent whenundefined.visualis always rendered inside anaria-hiddenwrapper.- Default inline padding applies;
<Page.FullBleed>neutralizes it for its subtree (box-model assertions). - Breadcrumb item shape matrix:
hrefonly →<a href>;href + onClick→<a href onClick>withonClickinvoked andpreventDefaultavailable;onClickonly →<button>; neither → non-interactive text. The last item always carriesaria-current="page"regardless of interactivity. linkComponentis used for items withhrefand not for<button>-rendered items; contract props are passed as declared.- Actions ordering: secondary → ellipsis trigger (when
overflownon-empty) → primary in DOM order; primary is visually right-aligned. - Overflow menu: ellipsis trigger has
aria-haspopup="menu"and translated name ("More actions"); opening reveals arole="menu"withrole="menuitem"children; arrow keys, Escape, and focus-return on close all work. - Actions cardinality is compile-time enforced: three items to
secondaryfails the build (type tests).
- Integration tests — a small suite that mounts
<Page>with representative content including<section aria-labelledby>blocks and a<Page.FullBleed>block, and:- Runs
axeagainst it in every variant combination. Matrix axes: with/withoutbreadcrumbs(drives the auto-hidden-title branch) × with/withoutbadges× actions shape (none, primary only, secondary only, primary + 1 secondary, primary + 2 secondary, overflow only, primary + 2 secondary + overflow) × with/withoutvisual× with/withoutleading× with/withoutPage.FullBleed× with/withoutlinkComponent× LTR / RTL. - Asserts landmark uniqueness and heading order using
@testing-library/react'sgetByRole('main'),getAllByRole('heading', { level: 1 }), etc. - Asserts the breadcrumbs-drives-hidden-title rule at both ends:
breadcrumbsnon-empty →<h1>is in the DOM but has an accessible-but-not-visible presentation;breadcrumbsempty →<h1>is visible.
- Runs
- Storybook + visual regression — a11y addon enabled, stories cover the matrix, and snapshots are wired into the existing Chromatic / Playwright pipeline. Stories live in
/storiesand are imported by docs. - Type tests (
tstycheor@ts-expect-errorcomments) — exhaustiveness of thePageBreadcrumbItemdiscriminated union, thelinkComponentcontract, and that disallowed combinations fail at compile time.
Route-change focus management is out of scope for admin-ui and not covered by this test matrix; consumer shells are responsible for it.
Coverage target: ~95% of src/ statements, 100% of invariants in §9.
11. Migration plan (breaking changes welcome)
Since we are explicitly accepting breaking changes, we publish a single major (@wordpress/admin-ui@2.0.0) that lands the redesign wholesale. A soft-deprecation period is not worth the double maintenance cost for a package with few external consumers.
11.1 Breaking changes (vs. current)
| Change | Migration |
|---|---|
Breadcrumbs removed. |
Pass breadcrumbs data to <Page>, or import Breadcrumb directly from @wordpress/ui. |
NavigableRegion removed from admin-ui. |
After rehoming per §13 Q2, update import paths in edit-post/components/layout, edit-site/components/layout, edit-site/components/save-panel, and interface/components/interface-skeleton. The component itself is unchanged. |
Page.SidebarToggleFill removed. |
Define a thin AppPage wrapper in the shell that forwards chrome as leading to <Page> (§4.5). No provider, no slot/fill. |
Page prop headingLevel removed. |
Title is always <h1>. Consumer-authored top-level content blocks are <h2>. |
hasPadding: boolean removed. |
Padding is on by default. Use <Page.FullBleed> to opt a single content block out (§4.3.a). |
subTitle → subtitle (casing consistency with WordPress conventions). |
Rename prop. |
ariaLabel removed; <Page> derives its accessible name from the <h1> via aria-labelledby. |
Stop passing ariaLabel; title is now required. |
No hideTitle prop. |
Behavior is automatic: when breadcrumbs is non-empty the <h1> is visually hidden (per #76709). Consumers stop passing hideTitle; there is nothing to opt into. |
actions is role-shaped: { primary?, secondary?, overflow? }, not a flat array with a variant field. |
Group actions by role. Primary button → primary; up to two secondary buttons → secondary: [a] or [a, b] (third element is a compile error); tertiary / long-tail actions → overflow. Admin-ui renders the ellipsis menu; do not provide one. Array order no longer influences render order. |
visual type narrowed to a plain decorative ReactNode. |
Pass <Icon icon={…} /> or an <img alt=""> directly; drop the { kind, … } shape. Informative imagery moves to the content area. |
| Routing coupling removed. | Attach navigation on breadcrumb item onClick, keep href for progressive enhancement, or pass linkComponent for component-based routers (§5.3). |
No size, density, or exported type aliases. |
One canonical layout / density; use React.ComponentProps<typeof Page> if a prop type is needed. |
11.2 Rollout steps
- A11y review of the spec. Before any code lands, share §6 (semantics), §9 (invariants), and §6.1 (the
<main>/useNavigateRegionstrade-off) with the WordPress a11y team (e.g. Joe Dolson) and collect sign-off or required adjustments. Freeze the contract after this step. - Land
@wordpress/ui/Breadcrumb(UI: Add Breadcrumb component (adapted from admin-ui) #77039) with container-aware behavior, the data-first{ href, onClick }item shape, and an optionallinkComponentprop for component-based routers (no provider, no function render-prop). Ship in a UI release. - Rehome
NavigableRegionper the decision on §13 Q2 (options listed in §2.1). Because no "original private API" exists today (PR Extract Page and NavigableRegion components to an admin-ui package #72106 moved it into admin-ui and deleted the interface copy), this is a prerequisite for step 4, not an incidental cleanup. The component itself is not modified — it moves as-is. The four consumer packages (edit-post,edit-site× 2,interface) update their imports. - Land
admin-ui@2.0.0exporting only<Page>(withPage.FullBleed) — noBreadcrumbs,NavigableRegion, slot-fill,Page.Section,PageContent, orPageChromeProvider. Router integration is the optionallinkComponentprop on<Page>. - Migrate boot to a thin
AppPagewrapper (exported from boot) that forwardsleadingto<Page>; drop<SlotFillProvider>if not otherwise needed. Route pages inside boot — including third-party plugins — importAppPagefrom@wordpress/boot; pages outside boot importPagefrom@wordpress/admin-ui. Document this boundary explicitly in boot's README so plugin authors understand the split. - Document breadcrumb → router integration (§5.3) with concrete recipes for static links, event-based routers, and component-based routers (including
@wordpress/route, React Router, and Next.js); optionally ship auseBreadcrumbLink()convenience helper in@wordpress/route. - Update Storybook stories and regenerate docs.
- Changelog: write a dedicated Breaking changes section with a migration table (§11.1 verbatim).
Separately tracked, not a prerequisite for 2.0:
- Generalize
useNavigateRegions(in@wordpress/components) to recognize native landmarks (<main>,<nav>,<aside>, labelled<section>) and handle focus without requiringtabindex="-1"to already be set. Deliverable: an issue in@wordpress/componentswith the proposal in §6.1; implementation follows after a11y confirms the approach. When this lands, admin pages pick up navigate-regions participation with no change toadmin-ui.
11.3 Risk checklist
- Any external consumer of
Breadcrumbs/NavigableRegionfromadmin-ui(none visible in-repo outside the places listed). Cover with a forward-only migration note. - Slot/Fill removal is invisible to end users; only
bootis affected. actionsshape restructure: in-repo consumers currently pass a flat array. Each call site has to regroup into{ primary?, secondary?, overflow? }— a manual edit, not a codemod (the input is too underspecified to infer role reliably). In-repo surface is small; no automation planned.<main>landmark uniqueness: audit any page that embeds another<Page>(shouldn't happen; nesting is unsupported per §7 and §9, but assert in tests).- RTL: CSS-modules migration should not regress RTL. Add visual snapshots in RTL mode.
12. Open questions and follow-ups
Open questions (to resolve before or during implementation)
Ordered roughly by how close they sit to blocking 2.0 — a11y sign-off and the NavigableRegion rehoming are gates; the rest can be decided during implementation.
-
A11y sign-off on the spec. §6 and §9 encode the accessibility contract; they need review by the WordPress a11y team (e.g. Joe Dolson) before 2.0 ships. Specifically to confirm: single
<main>per page,<h1>present even when visually hidden (auto-hidden when breadcrumbs are set, per Admin UI: Page header design spec #76709),aria-labelledbywiring, decorative-visual handling, actions group label ("Actions"),aria-current="page"on the last breadcrumb item regardless of interactivity, and the default of not making<Page>participate inuseNavigateRegions(§6.1). Gating. -
Where does
NavigableRegionlive after admin-ui drops the export? Options listed in §2.1: rehome to@wordpress/interface(natural owner), rehome to@wordpress/components(lives next touseNavigateRegions), or keep inside admin-ui as a non-public export vialock-unlock. The component itself is not modified either way. Gating for step 4 of the rollout. -
Header
navigationandcontrolsslots (Admin UI: Page header design spec #76709). The design spec lists two optional in-header elements not in this proposal: navigation (in-header horizontal nav with horizontal-scroll overflow) and controls (search / DataViews controls, which responsively stack with navigation). Decision for 2.0:- Responsive header stacking ships in 2.0. The rules governing overflow, collapsing, tagline truncation, and the mobile hamburger are internal
ResizeObserver-driven behavior (§4.3 and §6). No prop surface. navigationslot does not ship in 2.0. Design spec is retained as reference; the prop lands in a later minor when the first consumer needs it. Non-breaking addition.controlsslot does not ship in 2.0. Same reasoning. The spec couples its responsive behavior tonavigation, so shipping one without the other would be inconsistent — both land together.
- Responsive header stacking ships in 2.0. The rules governing overflow, collapsing, tagline truncation, and the mobile hamburger are internal
-
Dev validation: throw or warn in production? Default to "throw in dev, silent in production". If consumer apps want to fail loudly in production previews, surface that as a module-level flag on
admin-ui(not a provider) — the package intentionally ships no provider (§4.6). -
Whole-page full-bleed variant? Out of scope for 2.0. Default is padded,
<Page.FullBleed>is per-block. If a real need appears for an entirely edge-to-edge page (including the header), add a<Page>prop with an explicit spec-backed value — not before. See §4.3.a. -
Convenience helper for router integration.
useBreadcrumbLink()helper shipped in@wordpress/routeto remove boilerplate in consumer code — cheap, not strictly required. Decide during §11.2 step 6.
Separately tracked follow-ups (not blocking 2.0)
- Generalize
useNavigateRegionsin@wordpress/componentsto recognize native landmarks (<main>,<nav>,<aside>, labelled<section>) and to handle focus on elements without a pre-settabindex. Rationale and approach: §6.1. Owner:@wordpress/components. A11y team should review the selector + focus-management change before implementation. Once landed, admin pages automatically participate with no change toadmin-ui. navigation/controlsslots on<Page>. Deferred per Q3 above. Adding either is a non-breaking minor; revisit when a consumer needs them.- Split / detail layout patterns — not part of 2.0; may land in later minors if a need materializes.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
ciampo commentedon Apr 24, 2026
To external contributors: please do not open PRs for this issue; the spec is still under discussion.
This is an initial draft that I started working on last week. While we likely don't have the capacity to iterate on this right now, I'm opening an issue to provide a starting point. We can come back to this later.
cc @WordPress/gutenberg-components @WordPress/gutenberg-design @simison @CGastrell
aduth commentedon Apr 24, 2026
What's the advantage of a subcomponent over a prop, particularly if the component is otherwise monolithic and its other aspects will be configured through props?
Separately, as this starts to take shape, maybe this issue should serve more as a tracking issue, with discrete tasks broken out into their own sub-issues? That's already the case for a lot of the work described in the original issue, but there's still some gaps (e.g. element semantics). Correct me if I'm wrong, but my impression is it doesn't sound like we'll need to scrap and rebuild everything from scratch, so ideally we can incrementally adopt these improvements.
ciampo commentedon Apr 24, 2026
More control and less flexibility in determining the contents of the page. I thought it would be fitting for the needs at this level of abstraction
Absolutely. Happy to do that once there is consensus around the plan
Some aspects are more incremental than others. I haven't focused too much on that aspect for now; my priority so far was to create the right abstraction, regardless of how incremental/disruptive it would be
simison commentedon Apr 29, 2026
As I've seen this component used around plugins and Gutenberg, a few things have come up:
More opinionated canvas behaviour for common content types.
Currently, plugins and Gutenberg itself implement settings pages in various ways. Examples: AI settings, Gutenberg experiments, Gutenberg connectors and as a 3rd party plugin example Jetpack Newsletter settings. Since these pages are often built with similar components (DataForms, UI Cards, etc), it would make sense to have something that helps them stay more consistent at least within WordPress/Gutenberg itself.
Support Tabs
Currently, consumers can build tabbed content with the UI Tabs component, set the content to full-bleed, and then reset the content padding to whatever they actually need. Gutenberg's Fonts page is a good example
Adding Tabs with border-bottom also creates the "double border" boxy layout situation; if the Page understands Tabs natively, it can decide where the bottom-border of the header should be shown, and how each page of the tabs should be rendered (settings, full bleed, with padding).
Support footers
Currently, Page lacks a way to add a footer, and the core footer is missing on many core pages (Connectors, Experiments, Fonts, etc).
I'm not sure at what level of abstraction the core WP footer should get injected, but
Pageitself should offer a mechanism to show it. There are pages where the footer cannot visually work, such as full-width/height DataViews tables or editor pages. I'm not sure whether we can detect that situation automatically or if it would need to be controlled by the consumer via a prop.The Fonts page is an interesting example since it ships with its own fixed footer and styles for it, but the "Save" could get presented in some other way, too:
Consumers should be allowed to replace (or append) their own product footer, but Page would handle its accessibility & semantics (
<footer>), as well as fixed positioning in the page. Positioning on the consumer end is tedious and bug-prone if the styles of the page change. As an 3rd party example, Jetpack plugin footer:Support for Hello Dolly out of the box
Since the Hello Dolly plugin ships with WordPress, it would be a shame if the Boot package and Admin UI
Pagecomponent didn't support it out of the box.Currently, if one wants to make it work, each page/plugin needs to bring its own customisations to show Hello Dolly in the header using
Page. Any compatibility code could probably ship within the Hello Dolly plugin itself, but the point is that it would just work well and look good with the rest of the Header components.ciampo commentedon Apr 30, 2026
Thank you @simison , I'll digest the feedback later when I find some time to iterate on this again
ciampo commentedon May 8, 2026
Adding a link to #78001 to make sure we think our semantics better in the new version
aduth commentedon May 11, 2026
Between this and @ciampo's feedback in a project using
@wordpress/admin-ui, I think we should consider how we want consumers to handle navigation. Navigation is mentioned as out of scope for this initial "2.0" architecture, and maybe it's fine to separate those concerns. In which case I expect we'll want a separate issue for this (and likely the underlying NavigationMenu component mentioned by @ciampo in his feedback). And in the meantime we can expect people to invent their own solutions, including using Tabs in ways that we'd want to discourage.simison commentedon May 21, 2026
Adding that we should solve notice placements in classic WP Admin pages:
simison commentedon May 22, 2026
Recent work on experimental dashboard has an interesting example regarding header actions; it might make sense to allow both declarative header actions (which fold automatically under three dots) and consumers to build actions in a way that moves the mobile/desktop responsibility to them. This allows more flexibility (which is both good and troublesome), which I feel like the dashboard example justifies:
Screen.Recording.2026-05-22.at.11.46.36.mov
jasmussen commentedon May 22, 2026
I visually like that behavior very much, though want to flag that the behavior seems worth systematising so that it can become reusable (e.g. visual revisions has something similar when you enter and exit that modality), and properly accessible across all instances. In saying that I both agree there's something to what you propose, but saying also it should not be a one-off interface built only for the dashboard. (Which, by the way, looks fantastic!)
ciampo commentedon May 25, 2026
Agreed on systematising the behaviour. Specifically for Admin UI, I feel like this is a place where we may want to be quite prescriptive in what's possible from the consumer's PoV, otherwise we risk creating a weak abstraction. It also gives us a chance to impelement these patterns in an accessible way (which is not always trivial, especially when showing/hiding/replacing parts of the UI)
simison commentedon May 26, 2026
Yep; makes total sense to aim for it being declarative UI. The rigid vs flexible is something to explore with a few different use cases other than just a couple of CTAs in the header.
My biggest takeaway from the Dashboard wasn't even the mode -change in actions, the animation, or the little custom divider, but how custom the mobile version might sometimes need to be to produce good UX:
Screen.Recording.2026-05-26.at.19.19.45.mov
ciampo commentedon May 26, 2026
Out of curiosity, could "Customize" become another dropdown menu? It would allow us to reuse standard componentry, and work well across different viewport sizes
joedolson commentedon Jun 2, 2026
👍
I think it should also check for no more than one
headernot inside sectioning content and no more than onefooternot inside sectioning content, as these landmarks should only appear once.It would also be good to ensure that no content is output outside of these three elements.
I agree with ensuring the contract protects the single
h1model, but enforcing a hiddenh1if there are visible breadcrumbs isn't something I'm totally on board with. I read the issue in the spec about it, and I can see the logic. Given that it appears that breadcrumbs are designed to be of equivalent size to theh1, I think it's probably OK; the main thing I don't like about it is that it means the visual name of the page changes position depending on whether there are breadcrumbs, and I think that can be confusing/offputting.👍
Are there any cases where somebody could inject meaningful content or controls into the
visualslot? It seems potentially problematic to me to force a region to bearia-hiddenunless there's meaningful protection against it containing content or controls. (Noting that Axe should catch controls or content in side a container witharia-hidden: https://dequeuniversity.com/rules/axe/3.5/aria-hidden-focus). As I read above, you explicitly say that the consumer can pass anything into the slot; that would mean that a consumer could pass a button in, and if they didn't test properly for accessibility, they'd believe it was fine, but have created a significant accessibility error.👍
Should also verify that the accessible name contains the visible name.
👍
The only risk here would be of custom CSS that used the
orderattribute to move items visually while retaining their DOM order. But that seems like a low risk in core development, and rare for extenders.👍
Agreed that consumer content is out of our hands.
Overall, I think that the accessibility contract is a good starting point for the admin UI framework. As I understand it, this does not cover the admin nav or admin bar, as those are external components, so I didn't address anything related to that.
simison commentedon Jun 4, 2026
via
ciampo commentedon Jun 4, 2026
Those checks are hard to perform on consumer content, not sure we can do much there.
Gotcha. I'll look into ways to improve the predictability of where the
h1is rendered in the DOM, regardless of the breadcrumbs variant.As far as we document it well enough (ie, the contents associated with that prop are only meant to represent a visual decoration, ie. information that should not be otherwise exposed to assistive technology), I don't see that as being problematic.
Consumers passing meaningful / interactive content would be breaking the contract that the APIs set.
Similarly to the point above, consumers doing that would be expliclity misugin / breaking the APIs, and I don't think we need to cover that edge case. Moreover, consumers could apply custom styles to any part of any UI and change the order, so that's not really something specific to this part of Admin UI.
aduth commentedon Nov 18, 2026
Cross-referencing some points I made at #86701 (comment) that could be relevant for
Page's designed purpose. Notably, I propose there that we may want to remove some semantics of whatPagehandles today and have it focus more on UI consistency. Those semantics being DOM role (proposing removingrolevs. the original issue here proposing<main>) and removingtitlebehaviors, instead expecting those to be handled by routing mechanics in@wordpress/boot.The role point is also relevant insofar that: (1) WordPress itself already assigns
role=mainon one of the page wrapping elements and there should only be onemain, and (2) there's some guidance around wheremainshould live in a document (see Axelandmark-main-is-top-leveland HTML spec for<main>"ancestor elements are limited to html, body, div, form without an accessible name"). There may be a separate discussion to be had about whether WordPress's currentmainassignment is the correct one relative to the actual primary content of the page, but that's not incompatible with shifting the semantics to exist at the "stage" aspect of the route.ciampo commentedon Nov 25, 2026
Thanks for cross-posting, @aduth. I took this occasion as a change to read the plan again and assess it against latest
trunk, and I think you're right on most of this.Agreed, I'll drop
<main>from the plan. In wp-admin, boot mounts inside#wpbody-content, so a<main>inPagewould be a second main nested inside Core's. The v1 site editor sits under the same wrapper.Pagealso isn't always the primary content. 12 of the 22 call sites ontrunkpassheadingLevel={ 2 }, because the site editor'sh1is in the sidebar. So "exactly one<main>" and "always anh1" can't bePageinvariants.As far as I can tell, the full-page boot template has no main landmark at all. I think that's a gap in the template, and a separate issue.
This also makes sense, at least from a high level.
useRouteFocusalready looks for.stage [role="region"], which only finds something when the route happens to renderPage. Three things need sorting out beforePagecan drop its region:titleis optional, so the stage wouldn't always have a name.Pageis also used outside boot. There are five call sites inedit-site, plus plugins that render it on classic wp-admin screens. Those need to get the region from their own host first.This is the one where I'm less sure. The visible heading is part of the header layout, and
Pagehas to work without boot. I do agree that four sources for "the page's title" is too many. What about two?titlenames the document, the spoken announcement, and the stage region.Pagerenders the visible heading fromtitleor from the last breadcrumb, never both, andariaLabelgoes away.#86982 already gets most of the way there.
What I'd change in the plan
The description is partly stale by now, so I'll rewrite it as a tracking issue with sub-issues, as you suggested back in April. The main changes:
Pageguarantees one heading and a consistent header, and nothing aboutmain. I'll also add Joe's check that the accessible name contains the visible name.titleorbreadcrumbs, enforced by the types. That guarantees a name withoutariaLabel. It also replaces the "visually hiddenh1when breadcrumbs show" rule, which Joe wasn't fully on board with.headingLevelstays for now.Pageits defaults?admin-uiis bundled into each route, so React context can't carry the router link or the sidebar toggle from boot. The toggle only works today because slot/fill comes from@wordpress/components, which is shared. The same problem is holding up Admin UI: Update Page breadcrumbs to receive configuration array #86982 and Admin UI: Configure router Link to match exact to fix duplicate aria-current in breadcrumbs #87050. The plan's answer was anAppPagewrapper exported from boot. That works, but it tiesPage's props to the WordPress version, and every route would have to change its import. I'd rather find a small shared channel, and I'd like opinions on this one.actions, padding, and footer come last. All 12 call sites that setactionspass JSX today, including custom components such asAddNewTemplateandWidgetDashboard.Actions. A{ primary, secondary, overflow }shape made of{ label, onClick }items can't express those. Padding and footer are still waiting on design in Admin UI: opinionated canvas behaviour for common content types #78881 and Admin UI: support footers #78902.@wordpress/uiBreadcrumb(as compound parts, not the data shape the plan described), and thenavigationprop withcomponents.link, which makes the proposedlinkComponentprop redundant. The "2.0" label goes too, since the package is at 3.2.0.NavigableRegionstill needs a new home, but it's no longer the top blocker.What do y'all think?