Skip to content

[BootstrapAdminUi] Add a collapsible sidebar - #412

Open
loic425 wants to merge 1 commit into
Sylius:mainfrom
loic425:feat/bootstrap-admin-ui-sidebar-collapse
Open

loic425 wants to merge 1 commit into
Sylius:mainfrom
loic425:feat/bootstrap-admin-ui-sidebar-collapse

Conversation

@loic425

@loic425 loic425 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member
Q A
Branch? main
Bug fix? no
New feature? yes
BC breaks? no
License MIT

The shadcn admin UI lets admins collapse the sidebar to its icons to get more room for the content. The Bootstrap admin UI had no equivalent: the sidebar always takes 15rem on desktop.

This brings the same behaviour to the Bootstrap admin UI:

  • Toggle with a new button at the start of the navbar, with Ctrl/Cmd+B, or by clicking the rail on the sidebar edge.
  • Collapsed, the sidebar only shows the logo and the first-level icons (with their label as a tooltip). Clicking an item having children expands the sidebar with this item open. Items without an icon show their initial.
  • Persisted in the sidebar_state cookie, read on the server so there is no layout shift on page load.

Below the lg breakpoint nothing changes: the sidebar is still the burger menu, which the shortcut now toggles too.

The state lives on the <aside> (data-sidebar-state), and the styles only rely on the existing nav-link-title, dropdown-menu and dropdown-toggle classes, so apps overriding the menu template keep working. Apps overriding sidebar.html.twig (e.g. Sylius) need to add the controller and the attribute to get the feature.

Translations were added in en, fr, de, es, nl and pl. public/ assets were rebuilt with yarn build.

Bootstrap admin UI

sidebar-collapse-bootstrap.webm

Shadcn admin UI (for comparison)

sidebar-collapse-shadcn.webm

@loic425
loic425 marked this pull request as ready for review November 19, 2026 15:39
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.

2 participants