@flexilla/collapsible
Version:
A utility for creating collapsible sections in web applications, conserving space and improving user experience.
21 lines • 939 B
text/typescript
//#region src/collapsible.d.ts
/**
* Initializes a collapsible element with the specified state and height
* @param element - The HTML element to initialize as collapsible
* @param state - Initial state of the element ('open' or 'close')
* @param closeHeight - Height of the element when closed (by default: "0px")
*/
declare const initCollapsible: (element: HTMLElement, state?: "open" | "close", closeHeight?: string) => void;
/**
* Expands a collapsible element to its full height
* @param element - The HTML element to expand
*/
declare const expandElement: (element: HTMLElement) => void;
/**
* Collapses an element to the specified height
* @param element - The HTML element to collapse
* @param closeHeight - Height of the element when closed (default: "0px")
*/
declare const collapseElement: (element: HTMLElement, closeHeight?: string) => void;
//#endregion
export { collapseElement, expandElement, initCollapsible };