Skip to content

[6.x] Custom sidebar tabs - #20005

Merged
brandonkelly merged 8 commits into
6.xfrom
feat/sidebar-tabs
Oct 17, 2026
Merged

brandonkelly merged 8 commits into
6.xfrom
feat/sidebar-tabs

Conversation

@brandonkelly

@brandonkelly brandonkelly commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Description

Adds custom sidebar tabs to field layouts, plus icons for field layout tabs, and reworks the field layout designer around them.

Tab icons

  • Field layout tabs can have an icon (chosen in the tab's settings), shown before the tab's name in field layout designers and on element edit forms' tabs.
  • Adds Ui\Nodes\Tab::icon(), an $icon argument to Ui::addTab(), Cp\Components\Tab::icon(), and a prefix slot to <craft-tab>.
  • The MCP server's field layout config documents tabs' icon.

Sidebar tabs

  • Field layout tabs now have a type (CraftCms\Cms\FieldLayout\Enums\TabType): content (the default) or sidebar. Sidebar tabs always come after content tabs. The MCP server's field layout config documents tabs' type.
  • On element edit forms, sidebar tabs render as panels in the details sidebar, between Info and Activity, using the tab's icon (or its name's first letter) and name. Their fields stay part of the main form, so values, validation errors, conditional fields, and autosave work as before. Renderers without a sidebar (nested element blocks, generic UI pages, legacy forms) show them as ordinary tabs.
  • Adds Ui\Nodes\Tab::sidebar() and a $sidebar argument to Ui::addTab(). UiRenderer accepts sidebarTabOutlets to render sidebar tabs into, and DetailsPanels panels can show their label's initial instead of an icon.

Field layout designer

  • Content and sidebar tabs sit in separate "Content Tabs" and "Sidebar Tabs" panes, each with a New Tab button. The panes stack when the designer is narrow.
  • Tabs can be dragged between the panes, or moved with new "Move to the sidebar" / "Move to content" actions, to change their type.
  • Sidebar tabs protrude an icon-only tab from their content, with the name in a tooltip. Tabs without an icon show their name's first letter. Fields in sidebar tabs don't have width pickers.
  • The workspace drops its surface for a grid of dots that tabs line up with, with solid tab outlines and a ring keeping the dots clear of them. Panes stay a whole number of grid cells tall.
  • Drop placeholders for tabs and layout elements are now translucent blobs in the dragged item's shape.
  • The Display tab's card preview gets the same treatment, and the sample chip's outline now matches the card's.
  • Fixes applying a sidebar tab's settings, which returned its type as a serialized enum that couldn't be saved.

HUDs

  • HUD tips are now drawn in the HUD's own colors (rather than white images), and in dark mode HUDs and their tips get a light hairline outline.

🤖 Generated with Claude Code

brandonkelly and others added 7 commits October 16, 2026 14:09
Field layout tabs get an `icon` setting, chosen from their settings slideout,
which is shown before the tab's name in field layout designers and on edit
forms' tabs.

- Adds a `prefix` slot to `<craft-tab>`.
- Adds `Ui\Nodes\Tab::icon()` and an `$icon` argument to `Ui::addTab()`.
- Adds `Cp\Components\Tab::icon()`. `UiHtmlRenderer::tabMenu()` includes tabs'
  icons, which `LegacyTabsShim` shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MCP's field layout tools already pass tab icons through; the layout
schema's description (including the nullable variant used by update tools)
now mentions them, with a test that they're set, returned, and stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Field layout tabs now have a type: `content` (the default) or `sidebar`.
Sidebar tabs always come after content tabs.

In field layout designers:
- Content and sidebar tabs sit in separate "Content Tabs" and "Sidebar
  Tabs" panes, each with a New Tab button. The panes stack when the
  designer is narrow.
- Tabs can be dragged between the panes, or moved with the new "Move to
  the sidebar" / "Move to content" actions, to change their type.
- Sidebar tabs protrude an icon-only tab from their content, with the name
  in a tooltip. Tabs without an icon show their name's first letter.
- Fields in sidebar tabs don't have width pickers.
- The workspace drops its surface for a grid of dots, with solid tab
  outlines and a ring keeping the dots clear of them. Drop placeholders
  are now translucent blobs in the dragged item's shape.

Also fixes applying a sidebar tab's settings, which returned its type as a
serialized enum that couldn't be saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sidebar tabs now render as panels in element edit forms' details sidebar,
between Info and Activity, using the tab's icon (or its name's first
letter) and name. Their fields stay part of the main form, so values,
validation errors, conditional fields, and autosave work as before.
Renderers without a sidebar, such as nested element blocks, show them as
ordinary tabs.

- Adds `Ui\Nodes\Tab::sidebar()` and a `$sidebar` argument to
  `Ui::addTab()`.
- `UiRenderer` accepts `sidebarTabOutlets` to render sidebar tabs into.
- `DetailsPanels` panels can show their label's initial instead of an
  icon, via `initialIcon`.

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

The Display tab's preview drops its surface for the field layout
designer's dot grid, with hairlines separating it from the settings beside
it and along the bottom. The sample chip and card get a ring keeping the
dots clear of them, and the chip's outline now matches the card's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HUD tips were white images, which stood out in dark mode. They're now
drawn in the HUD's own colors, and in dark mode HUDs (tips included) get a
light hairline outline, like other surfaces.

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 commented Oct 17, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

Changed components:

resources/js — open Storybook

No changed components detected in this Storybook.

@brandonkelly brandonkelly changed the title [6.x] Sidebar tabs [6.x] Custom sidebar tabs Oct 17, 2026
- Tabs' and New Tab buttons' outlines are darker in light mode.
- They now use the small drop shadow.
- The ring keeping the dots clear of them is white in light mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonkelly
brandonkelly merged commit 06eb168 into 6.x Oct 17, 2026
9 checks passed
@brandonkelly
brandonkelly deleted the feat/sidebar-tabs branch October 17, 2026 02:59
@linear-code

linear-code Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

CMS-2530

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant