jQuery Mobile Collapsibles
Collapsible content blocks
Collapsibles allow you to hide or show content - useful for storing partial information.
To create a collapsible content block, add the data-role="collapsible" attribute to the container. Inside the container (div), add a heading element (H1-H6), followed by the HTML markup you want to expand:
Example
Click me - I can collapse!
I am collapsible content.
Try it »
By default, content is collapsed. To expand the content on page load, use data-collapsed="false":
Example
Click me - I can collapse!
I'm now expanded by default.
Try it »
Nested collapsibles
Collapsible content blocks can be nested within each other:
Example
Click me - I can collapse!
I am expanded content.
Click me - I am a nested collapsible!
I am expanded content inside a nested collapsible.
Try it »
![]() |
Collapsible content blocks can be nested as many times as you need. |
|---|
Collapsible sets
A collapsible set groups collapsibles together (like an accordion). When a new block is expanded, all other blocks are collapsed.
Create several collapsible content blocks, then wrap them in a new container with data-role="collapsible-set":
Example
Click me - I can collapse!
I am expanded content.
Click me - I can collapse!
I am expanded content.
Try it »
More examples
Remove rounded corners and margins with the data-inset attribute
How to remove rounded corners and margins on a collapsible.
Minimize a collapsible with the data-mini attribute
How to make a collapsible smaller.
Change icons with data-collapsed-icon and data-expanded-icon
How to change the icons of a collapsible (the default is + and -).
Using collapsibles in a popup
Create a collapsible in a popup.
Change icon position
How to change the icon position in a collapsible (the default is on the left).
