Axinom Mosaic Libraries
    Preparing search index...

    Function useExpand

    • Determines if state isExpanded (default: false)

      Parameters

      • initialValue: boolean = false

      Returns {
          collapse: () => void;
          expand: () => void;
          isExpanded: boolean;
          toggleExpanded: () => void;
      }

      isExpanded returns the current state

      expand will set isExpanded to true

      collapse will set isExpanded to false

      toggleExpanded will toggle isExpanded state

      <div>
      <span>{String(isExpanded)}</span>
      <button id="expand" onClick={expand}></button>
      <button id="collapse" onClick={collapse}></button>
      <button id="toggle" onClick={toggleExpanded}></button>
      </div>