components
Tailwind CSS Remove element
Easily remove elements with just a single click, streamlining your workflow and enhancing user experience.
Include the data-remove-element
attribute in the close button element and set its value to #id
to specify the element to be removed.
Customize the removal animation by incorporating the removing:
modifier, as illustrated below.
With a single click on the close button, this card will be effortlessly removed.
Below example demonstrates use of remove-element
in badges.
Below example demonstrates use of remove-element
in alerts.
destroy
method is provided to facilitate the destruction of a remove element.With a single click on the close button, this card will be effortlessly removed.
In the data-remove-element-options
attribute, assign an object as its value.
Within this object, define the removeTargetAnimationClass
key as a Tailwind CSS class, which will be applied during the removal process.By default, this value is derived from the modifier class removing:
, but it can also be specified using this data attribute option.
With a single click on the close button, this card will be effortlessly removed.
The HSRemoveElement
object is contained within the global window
object.
Destroy the instance if the `Id` is added to the `data-remove-element` attribute, or use it as shown in the example above.