5-day Mini-Course

Build UIs that don’t suck.

Short, tactical video lessons from the creator of Tailwind CSS, delivered directly to your inbox every day for a week.

Get the free course

Disclosure

A commercial license is required to use Tailwind Plus Elements. Purchase Tailwind Plus to obtain a license.

The <el-disclosure> component provides a simple, accessible way to show and hide content — ideal for building things like toggleable accordion panels or expandable sections.

Component API

<el-disclosure>

Contains the content of the disclosure.

Attributes
hiddenWhether the disclosure is initially hidden (closed).
openAutomatically synced with the hidden attribute.
Data attributes (Read-only)
data-closedPresent before transitioning in, and when transitioning out.
data-enterPresent when transitioning in.
data-leavePresent when transitioning out.
data-transitionPresent when transitioning in or out.
Methods
show()Shows the disclosure.
hide()Hides the disclosure.
toggle()Toggles the disclosure.
Commands
--showShows the disclosure.
--hideHides the disclosure.
--toggleToggles the disclosure.

Examples

Basic example

To view the complete documentation, you must own a Tailwind Plus license and be signed in.

Opening a disclosure

To view the complete documentation, you must own a Tailwind Plus license and be signed in.

Closing a disclosure

To view the complete documentation, you must own a Tailwind Plus license and be signed in.

Toggling a disclosure

To view the complete documentation, you must own a Tailwind Plus license and be signed in.

Adding transitions

To view the complete documentation, you must own a Tailwind Plus license and be signed in.