-
Notifications
You must be signed in to change notification settings - Fork 53
[RFC] Toolbar Component #461
Comments
Looking at the patterns in Stardust, I think it would make more sense to have something like this: <Toolbar>
<Toolbar.Group name="BasicFormatting">
<Button name="bold" icon="underline" onClick={() => {}} />
</Toolbar.Group>
<Toolbar.Group name="ExtraFormatting">
<Picker name="picker">
{pickerContent}
</Picker>
</Toolbar.Group>
</Toolbar>; |
We may also want to add support for alignment. I think a good example can be something like Fabric's commandbar or an extension to Semantic UI React - Menu component |
The Picker / subMenu parts seem a little feature specific. Does the toolbar need to care if a given button is rendering a Picker or not? |
@WrathOfZombies it seems that ShorthandApi is generally preferred over ChildrenApi. Here are a few advantages of Shorthand over ChildrenApi https://stardust-ui.github.io/react/shorthand-props also in #79 @levithomason put together a nice analysis on supporting ChildrenApi I like the idea of supporting alignment. I'll consider that! |
@stuartlong from an accessibility standpoint it may be important to identify that a given button will render a popup when pressed. The submenu parts may not need to be here, but there should be a way to assign accessibility traits/roles to specific buttons in the toolbar. |
@joheredi Toolbar component it's a nice idea, but I don't feel like it should be a part of Stardust components. <Menu
items={items}
iconOnly
accessibility={ToolbarBehavior}
aria-label="Compose Editor"
/>
const items = [
...
{
key: 'cloud',
icon: {
name: 'cloud',
circular: true,
xSpacing: 'both',
size: 'small',
},
accessibility: ToolbarButtonBehavior,
'aria-label': 'Cloud Tool',
},
...
] Recently, I prototyped the similar popup picker which contains Grid of images and opens from clicking on a button. Please, reach me, if you want to see more details on it and we can also try to prototype the similar toolbar that will match your needs. |
We had several discussions around this. It looks like Menu component provides most of the functionality already. Things that are missing from menu right now are:
Submenu would allow creating the overflow menu. If the Paragraph button in the mock above would be implemented as a submenu, it would be easy to dynamically move it to the overflow menu and have a second level submenu out of it. |
I will agree there with @sophieH29 and @jurokapsiar, we need this component for Teams, but it's a very specific thing and doesn't fit Stardust. I'm fully agree that it can be built with the |
To recap submenu requirements: Once submenu functionality gets added to the Menu component, we can use that for both the Formatting 'dropdown' as well as for the overflow. The overflow is at that point out of scope of Stardust and the consumer can implement that on his side using submenu. In general, toolbar needs to follow https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html - it should be possible to recreate that using our Menu component and Toolbar/ToolbarButton behaviors. The difference will be that Menu renders |
Reasons why 1. Ability to have multiple items in active stateThis behavior cannot be easily achieved using the 2. Ability to customize
|
also requested in #1007 |
I think 1 and 2 can be rephrased and both are valid requirements for both Menu and Toolbar:
3 will be solved by #1008 I think we can either introduce a |
@layershifter Should we vote on this one? From @jurokapsiar 's last reply it looks like we could achieve most of the scenarios with the current |
One requirement that I don't think I've seen in the comments here yet (could be wrong..), that I would love to see added... Some way to control positioning of certain items in the Going back to Fabric's CommandBar, one way this is expressed is as In the current "Icon and content" example for the |
as per discussions we had recently with @levithomason @kuzhelov and @miroslavstastny we will proceed with a new |
addressed by #1408 with base implementation for |
Feature Request
Overview
The toolbar is a component which houses different tools/buttons. The toolbar can have multiple groups to help organize buttons.
Requirements
Mock: Toolbar with submenu

Mock: Toolbar with Custom Picker

Mock: Button overflow flyout:

Proposed solution
Use the following stardust components to build up the Toolbar:
Menu
+MenuItem
- For the buttonsSubMenu
Submenu
for the overflow flyoutPopup
- For custom pickerGrid
to layout the ToolbarInternal structure:
Grid
ToolbarGroup
Menu
Toolbar
ToolbarGroup
Usage example
The text was updated successfully, but these errors were encountered: