• Determines if state isExpanded (default: false)

    Parameters

    • initialValue: boolean = false

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

    • Readonly collapse: (() => void)
        • (): void
        • Returns void

    • Readonly expand: (() => void)
        • (): void
        • Returns void

    • Readonly isExpanded: boolean
    • Readonly toggleExpanded: (() => void)
        • (): void
        • Returns void

    Member

    isExpanded returns the current state

    Member

    expand will set isExpanded to true

    Member

    collapse will set isExpanded to false

    Member

    toggleExpanded will toggle isExpanded state

    Example

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

Generated using TypeDoc