Skip to content

[Question]: How to Expand/Collapse Right Panel (Header Panel) #11612

Answered by jnm2377
AntonSRial asked this question in Help
Discussion options

You must be logged in to vote

Hi @AntonSRial to collapse and expand the HeaderPanel component, you'd need to use a state. Set the state value as the expanded prop value, and on HeaderGlobalAction click you would update that state to toggle the expansion.

Something like:

const [isExpanded, setIsExpanded] = useState(false);

const toggleExpand = ( ) => { 
setIsExpanded(!isExpanded)
}

<HeaderGlobalAction onClick={toggleExpand}> [icon] </HeaderGlobalAction>
<HeaderPanel expanded={isExpanded}> [panel items] </HeaderPanel>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jnm2377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
2 participants
Converted from issue

This discussion was converted from issue #11299 on June 13, 2022 22:33.