Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Toolbar] Add Toolbar components #1349

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Jan 21, 2025

Docs:

https://deploy-preview-1349--base-ui.netlify.app/react/components/toolbar

Demos:

Summary

  • parts: Root, Button, Input, Link, Group, Separator
  • focusableWhenDisabled prop on Button & Input
  • orientation prop
  • roving focus, loop prop
  • hotkey prop on Root [Toolbar] Support an optional hotkey #1454
  • grid layout with cols prop

Component integrations

The three demos linked above show all of these:

  • Dialog/AlertDialog
  • Menu
  • Menu with submenu
  • Popover
  • Select
  • Toggle/ToggleGroup
  • Tooltip
  • NumberField using Toolbar.Input
  • DirectionProvider
  • Input this will be a Toolbar.Input instead
  • Switch

Closes #661

@mj12albert mj12albert added the component: toolbar The React component. label Jan 21, 2025
Copy link

netlify bot commented Jan 21, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 820b590
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/67b70618c2034a0008ce0b7c
😎 Deploy Preview https://deploy-preview-1349--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mj12albert mj12albert force-pushed the feat/toolbar branch 2 times, most recently from f2b6d91 to 9c3111f Compare January 27, 2025 08:45
@mj12albert mj12albert changed the title feat/toolbar [Toolbar] Add Toolbar components Jan 28, 2025
@mj12albert mj12albert force-pushed the feat/toolbar branch 7 times, most recently from 5dcde0c to 5fe85d2 Compare February 6, 2025 15:47
@aarongarciah
Copy link
Member

I found a strange behavior: the menu won't close when a submenu is open and you move the roving focus to the next toolbar element by pressing ➡️. Only the submenu is closed. See attached video.

Kapture.2025-02-07.at.07.45.58.mp4

@mj12albert

This comment was marked as outdated.

@mj12albert mj12albert force-pushed the feat/toolbar branch 2 times, most recently from 52068e8 to 557bbd4 Compare February 20, 2025 07:48
@mj12albert
Copy link
Member Author

mj12albert commented Feb 20, 2025

  • In the Triggers experiment, it seems like disabling controls doesn't work properly? When I disable the switch individually, that works. But when I disable the Dialog individually, that doesn't work. I saw this was called out before, at least in some capacity

OK it turns out various triggers have issues with the disabled state when they are not native button elements disabled with the disabled attribute (i.e. a custom element disabled using aria-disabled/data-disabled)

The fix depends on #1445

Before some of these experiments seemed to work occasionally because I was passing the disabled state 2-3 times, to the trigger, the root, and the toolbar button at the same time, but it should only be passed once to the toolbar button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: toolbar The React component. new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Toolbar] Implement Toolbar
3 participants