Skip to main content
K
Last modified: 4/Oct/2024

useCollapse

Utility hook for handling expand/collapse structures.

#Usage

import { useCollapse } from '@kinsta/stratus' const MyComponent = () => { const { ref, isCollapsed, setIsCollapsed } = useCollapse() return ( <div ref={ref}> This is a collapsible area </div> ) }

#Parameters

#isCollapsed
Required
boolean
#mode
modeTypes
vertical
#parentRef
Required
RefObject<HTMLDivElement>

#Types

  • UseCollapseType: type of the useCollapse hook

Read more about types here