Right now every Accordion is initially closed, and cannot be opened programmatically (only by the user clicking on it). In some situations, users of Codex may want to create Accordions that are initially open, or may want to programmatically open and close Accordions (e.g. to create a group of Accordions where only one is open at a time).
To enable this, we could take two different approaches:
- Add a v-model:open prop, like the one Dialog has
- Make this prop required (like in Dialog). This would be a breaking change, and would also force users to set up v-model:open="open" even if they don't need the ability to control the open/closed state (which is the most common case)
- Make this prop optional, somehow. This would require some creativity, and we don't fully know if this is possible. We considered doing this for Tabs (where having to bind v-model:active is also annoying, because most use cases don't need it) but decided against it.
- Add an initiallyOpen prop, similar to the initialInputValue props in Lookup and TypeaheadSearch
- Don't provide the ability to programmatically read/write the open/closed state beyond the initial value. This mirrors Lookup/TypeaheadSearch, which don't allow reading/writing the input value.
- Add open, close methods to allow writing the open/closed state, and an isOpen method and/or an event for reading the open/closed state. Using methods for this isn't The Vue Way (TM), but it may be worth it if we decide that we want to provide this kind of control and that we don't want to use v-model.