Ship faster with goilerplate templUI Pro

Collapsible

An interactive component which expands/collapses a panel.

Source Tailwind CSS JavaScript

@axadrn starred 3 repositories

github.com/a-h/templ
github.com/charmbracelet/bubbletea
github.com/labstack/echo

Installation

  1. Install the component

    templui add collapsible
  2. Add the JavaScript to your layout

    @collapsible.Script()
    

    Call this template in your base layout file (e.g., in the <head> section).

API Reference

Required parameter
Hover for description

Collapsible

Root container for collapsible content. Controls the open/closed state.

Name Type Default
ID
string
auto-generated
Class
string
-
Attributes
templ.Attributes
-
Open
bool
false

Trigger

Button that toggles the collapsible content. Automatically handles click events and keyboard navigation.

Name Type Default
ID
string
-
Class
string
-
Attributes
templ.Attributes
-

Content

Content that expands and collapses. Uses smooth height transitions for animations.

Name Type Default
ID
string
-
Class
string
-
Attributes
templ.Attributes
-