2.0.2 • Published 1 month ago

@flexilla/collapse v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Collapse Component

The Collapse component is used to hide and show an element.

Params

ParamsDescriptionType
collapseElementThe element to be collapsed/expandedHTMLElement
triggerElementThe element that triggers the collapseHTMLElement | null
optionsAdditional options for the CollapseCollapseOptions

CollapseOptions

OptionDescriptionType
orientationThe orientation of the collapse"vertical" | "horizontal" | "vertical"
defaultStateThe default state of the collapse"open" | "close" | "close"

Example

const options = {
  orientation: "vertical",
  defaultState: "close",
};

const collapse = new Collapse(
  '#myCollapseElement',
  options,
  '#myTriggerElement',
);

// Show the collapse element
collapse.show();

// Hide the collapse element
collapse.hide();

// Toggle the collapse element
collapse.toggle();
2.0.2

1 month ago

2.0.1

3 months ago

2.0.0

3 months ago

1.1.0

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago