ibm-products
ibm-products copied to clipboard
Investigate standardization of controllable state
This issue is based on a suggestion from @janhassel in #1521.
What will this achieve?
Provide a more consistent approach for handling optional state (e.g. open on OptionsTile or SidePanel).
Additional information
@elycheea can we add further information regarding what is to be done and which components this impacts on?
@lee-chase At a glance, it looks like the Carbon hook is used in Toggle, ContentSwitcher, Tabs but not Accordion 🤔 so I’ll look into it a bit more and add more detail here.
Still looks as though useControllableState, from Carbon is used in Toggle, ContentSwitcher, and Tabs. I can start by looking into incorporating it into OptionsTile which was requested (see here).
Will add to side panel as well.
After looking at this further, I think SidePanel is somewhat different because the panel is triggered from an element outside of itself. Whereas, the OptionsTile is triggered from itself. Because of this, I don't think useControlledState is something that the SidePanel needs to use.