mui / base-ui

Base UI is a library of headless ("unstyled") React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
https://mui.com/base-ui/
MIT License
179 stars 34 forks source link

[Accordion] Implement Accordion #25

Open michaldudak opened 11 months ago

michaldudak commented 11 months ago

This is the place to gather ideas, measure interest and discuss the API and implementation details of the accordion component and hook.

See https://github.com/mui/base-ui/issues/10 for the umbrella issue to track progress on Base UI and https://github.com/mui/material-ui/issues/6218 for the problem this project solve.

oliviertassinari commented 10 months ago

Material UI id API feels so outdated (e.g. id={summary.props['aria-controls']}) now that we can use the context and useId https://mui.com/material-ui/react-accordion/#basic-accordion

Screenshot 2023-08-15 at 00 52 48
oliviertassinari commented 10 months ago

To consider what we should do with the arrow key navigation https://www.w3.org/WAI/ARIA/apg/patterns/accordion/#keyboardinteraction. I don't know if we want this, I guess, why not?

logonoff commented 5 months ago

an idea for the base-ui accordion component is to use the details and summary HTML elements for the component so that the accordion would still work for users who have javascript turned off. i feel like semantically it might also make more sense since its functionality is similar to the accordion component

michaldudak commented 5 months ago

Related issue to take into consideration: https://github.com/mui/material-ui/issues/36297