Skip to content

Can the Accordion trigger text change depending on whether the parent item is open or not? #1515

Answered by benoitgrelard
hoggworks asked this question in Help
Discussion options

You must be logged in to vote

Hi @hoggworks,

You should be able to achieve what you are after by using the controlled API of Accordion (value, onValueChange).
You then are the one providing the state, and can switch your text based on whether the current value is the one in each item (or contains, if you allow multiple opened at the same time).

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@andy-hook
Comment options

Answer selected by andy-hook
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants