[Toolkit][Shadcn] Add menubar recipe#3486
Conversation
|
Main example Capture.video.du.2026-04-19.19-20-55.mp4 |
|
Checkbox example (better than original) Capture.video.du.2026-04-19.19-24-46.mp4 |
|
Radio example (better than original) Capture.video.du.2026-04-19.19-39-30.mp4 |
|
Submenu example : Capture.video.du.2026-04-19.19-41-19.mp4 |
|
With icons : Capture.video.du.2026-04-19.19-43-56.mp4 |
|
RTL example Capture.video.du.2026-04-19.19-49-43.mp4 |
d89e1c0 to
4185895
Compare
Follow up on the review feedback on symfony#3487: the Trigger and SubTrigger templates should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element.
1ebf71c to
76bcd84
Compare
Apply the same hover/focus pattern as hover-card and navigation-menu. The previous CSS-only approach (group-hover + group-focus-within + tabindex=0 on submenu) left submenus stuck open after a click. Add a shared menubar_controller.js toggling data-state, wire mouseenter/ mouseleave on Menu and Sub, focus/blur on Trigger and SubTrigger, and switch Content + SubContent to in-data-[state=open] selectors.
76bcd84 to
ff6220a
Compare
|
Hi @Kocal! Just pushed an update aligning this recipe with the patterns we've validated on the other Shadcn components shipped recently (notably hover-card #3478 merged earlier today). The original implementation relied on the pure-CSS The fix follows the same approach as hover-card and navigation-menu, with one menubar-specific twist:
Companion PR for ux.symfony.com is updated too: symfony/ux.symfony.com#69. No rush at all, just letting you know it's ready for another look! 🙏 |
Avoid duplicating the radio group `name` on each `Menubar:RadioItem`. The parent `Menubar:RadioGroup` now exposes its `name` to its direct children through a Twig variable; `RadioItem` falls back to it when its own `name` is omitted.
Adds the
menubarrecipe to the Shadcn kit.Part of the split of #3468 into one PR per component, tracking #3233.
Snapshots will be regenerated after rework.