2014-07-12 11:20:15 +02:00
---
2015-08-15 07:45:55 +02:00
layout: docs
2014-07-12 11:20:15 +02:00
title: Collapse
2016-10-03 03:19:47 +02:00
description: Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
2015-08-06 02:47:45 +02:00
group: components
2017-05-28 08:01:14 +02:00
toc: true
2014-07-12 11:20:15 +02:00
---
2018-04-01 03:36:10 +02:00
## How it works
2018-10-19 10:16:12 +02:00
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific elements you toggle. Collapsing an element will animate the `height` from its current value to `0` . Given how CSS handles animations, you cannot use `padding` on a `.collapse` element. Instead, use the class as an independent wrapping element.
2018-04-01 03:36:10 +02:00
2019-01-08 17:33:28 +01:00
{{< callout info > }}
{{< partial " callout-info-prefersreducedmotion . md " > }}
{{< / callout > }}
2018-11-03 19:23:26 +01:00
2014-12-01 05:17:45 +01:00
## Example
2014-03-17 03:03:53 +01:00
2014-12-01 05:17:45 +01:00
Click the buttons below to show and hide another element via class changes:
- `.collapse` hides content
- `.collapsing` is applied during transitions
2016-10-28 00:13:17 +02:00
- `.collapse.show` shows content
2014-12-01 05:17:45 +01:00
You can use a link with the `href` attribute, or a button with the `data-target` attribute. In both cases, the `data-toggle="collapse"` is required.
2019-01-08 17:33:28 +01:00
{{< example > }}
2015-08-11 18:50:36 +02:00
< p >
2017-11-09 06:56:07 +01:00
< a class = "btn btn-primary" data-toggle = "collapse" href = "#collapseExample" role = "button" aria-expanded = "false" aria-controls = "collapseExample" >
2015-08-11 18:50:36 +02:00
Link with href
< / a >
< button class = "btn btn-primary" type = "button" data-toggle = "collapse" data-target = "#collapseExample" aria-expanded = "false" aria-controls = "collapseExample" >
Button with data-target
< / button >
< / p >
< div class = "collapse" id = "collapseExample" >
2017-06-15 07:01:16 +02:00
< div class = "card card-body" >
2015-08-11 18:50:36 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
2014-12-01 05:17:45 +01:00
< / div >
2015-08-11 18:50:36 +02:00
< / div >
2019-01-08 17:33:28 +01:00
{{< / example > }}
2014-12-01 05:17:45 +01:00
2017-06-15 11:28:48 +02:00
## Multiple targets
2017-06-14 13:21:49 +02:00
2019-02-19 15:19:02 +01:00
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a selector in its `href` or `data-target` attribute.
2017-10-04 11:46:36 +02:00
Multiple `<button>` or `<a>` can show and hide an element if they each reference it with their `href` or `data-target` attribute
2017-06-14 13:21:49 +02:00
2019-01-08 17:33:28 +01:00
{{< example > }}
2017-06-14 13:21:49 +02:00
< p >
2017-11-09 06:56:07 +01:00
< a class = "btn btn-primary" data-toggle = "collapse" href = "#multiCollapseExample1" role = "button" aria-expanded = "false" aria-controls = "multiCollapseExample1" > Toggle first element< / a >
2017-08-30 08:07:45 +02:00
< button class = "btn btn-primary" type = "button" data-toggle = "collapse" data-target = "#multiCollapseExample2" aria-expanded = "false" aria-controls = "multiCollapseExample2" > Toggle second element< / button >
2017-06-14 13:21:49 +02:00
< button class = "btn btn-primary" type = "button" data-toggle = "collapse" data-target = ".multi-collapse" aria-expanded = "false" aria-controls = "multiCollapseExample1 multiCollapseExample2" > Toggle both elements< / button >
< / p >
< div class = "row" >
< div class = "col" >
< div class = "collapse multi-collapse" id = "multiCollapseExample1" >
2017-06-15 07:01:16 +02:00
< div class = "card card-body" >
2017-06-14 13:21:49 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
< / div >
< / div >
< / div >
< div class = "col" >
< div class = "collapse multi-collapse" id = "multiCollapseExample2" >
2017-06-15 07:01:16 +02:00
< div class = "card card-body" >
2017-06-14 13:21:49 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
< / div >
< / div >
< / div >
< / div >
2019-01-08 17:33:28 +01:00
{{< / example > }}
2017-06-14 13:21:49 +02:00
2015-08-11 18:50:36 +02:00
## Accordion example
2014-12-01 05:17:45 +01:00
2019-02-04 11:22:02 +01:00
Using the [card ]({{< docsref "/components/card" >}} ) component, you can extend the default collapse behavior to create an accordion. To properly achieve the accordion style, be sure to use `.accordion` as a wrapper.
2014-07-13 09:54:21 +02:00
2019-01-08 17:33:28 +01:00
{{< example > }}
2018-04-26 16:51:54 +02:00
< div class = "accordion" id = "accordionExample" >
2015-08-20 21:34:13 +02:00
< div class = "card" >
2018-01-02 19:19:47 +01:00
< div class = "card-header" id = "headingOne" >
2018-11-11 10:12:29 +01:00
< h2 class = "mb-0" >
2018-02-16 18:37:09 +01:00
< button class = "btn btn-link" type = "button" data-toggle = "collapse" data-target = "#collapseOne" aria-expanded = "true" aria-controls = "collapseOne" >
2014-03-17 03:03:53 +01:00
Collapsible Group Item #1
2018-01-02 19:19:47 +01:00
< / button >
2018-11-11 10:12:29 +01:00
< / h2 >
2014-03-17 03:03:53 +01:00
< / div >
2015-12-01 23:17:35 +01:00
2018-04-26 16:51:54 +02:00
< div id = "collapseOne" class = "collapse show" aria-labelledby = "headingOne" data-parent = "#accordionExample" >
2017-06-15 07:01:16 +02:00
< div class = "card-body" >
2016-10-10 01:32:19 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
< / div >
2014-03-17 03:03:53 +01:00
< / div >
< / div >
2015-08-20 21:34:13 +02:00
< div class = "card" >
2018-01-02 19:19:47 +01:00
< div class = "card-header" id = "headingTwo" >
2018-11-11 10:12:29 +01:00
< h2 class = "mb-0" >
2018-02-16 18:37:09 +01:00
< button class = "btn btn-link collapsed" type = "button" data-toggle = "collapse" data-target = "#collapseTwo" aria-expanded = "false" aria-controls = "collapseTwo" >
2014-03-17 03:03:53 +01:00
Collapsible Group Item #2
2018-01-02 19:19:47 +01:00
< / button >
2018-11-11 10:12:29 +01:00
< / h2 >
2014-03-17 03:03:53 +01:00
< / div >
2018-04-26 16:51:54 +02:00
< div id = "collapseTwo" class = "collapse" aria-labelledby = "headingTwo" data-parent = "#accordionExample" >
2017-06-15 07:01:16 +02:00
< div class = "card-body" >
2016-10-10 01:32:19 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
< / div >
2014-03-17 03:03:53 +01:00
< / div >
< / div >
2015-08-20 21:34:13 +02:00
< div class = "card" >
2018-01-02 19:19:47 +01:00
< div class = "card-header" id = "headingThree" >
2018-11-11 10:12:29 +01:00
< h2 class = "mb-0" >
2018-02-16 18:37:09 +01:00
< button class = "btn btn-link collapsed" type = "button" data-toggle = "collapse" data-target = "#collapseThree" aria-expanded = "false" aria-controls = "collapseThree" >
2014-03-17 03:03:53 +01:00
Collapsible Group Item #3
2018-01-02 19:19:47 +01:00
< / button >
2018-11-11 10:12:29 +01:00
< / h2 >
2014-03-17 03:03:53 +01:00
< / div >
2018-04-26 16:51:54 +02:00
< div id = "collapseThree" class = "collapse" aria-labelledby = "headingThree" data-parent = "#accordionExample" >
2017-06-15 07:01:16 +02:00
< div class = "card-body" >
2016-10-10 01:32:19 +02:00
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
< / div >
2014-03-17 03:03:53 +01:00
< / div >
< / div >
< / div >
2019-01-08 17:33:28 +01:00
{{< / example > }}
2014-07-13 09:54:21 +02:00
2015-04-17 01:56:40 +02:00
## Accessibility
2019-07-13 09:04:49 +02:00
Be sure to add `aria-expanded` to the control element. This attribute explicitly conveys the current state of the collapsible element tied to the control to screen readers and similar assistive technologies. If the collapsible element is closed by default, the attribute on the control element should have a value of `aria-expanded="false"` . If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute on the control based on whether or not the collapsible element has been opened or closed (via JavaScript, or because the user triggered another control element also tied to the same collapsible element). If the control element's HTML element is not a button (e.g., an `<a>` or `<div>` ), the attribute `role="button"` should be added to the element.
2015-04-17 01:56:40 +02:00
2018-01-02 19:19:47 +01:00
If your control element is targeting a single collapsible element – i.e. the `data-target` attribute is pointing to an `id` selector – you should add the `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.
Note that Bootstrap's current implementation does not cover the various keyboard interactions described in the [WAI-ARIA Authoring Practices 1.1 accordion pattern ](https://www.w3.org/TR/wai-aria-practices-1.1/#accordion ) - you will need to include these yourself with custom JavaScript.
2014-09-18 00:21:31 +02:00
2014-07-13 09:54:21 +02:00
## Usage
The collapse plugin utilizes a few classes to handle the heavy lifting:
- `.collapse` hides the content
2016-10-28 00:13:17 +02:00
- `.collapse.show` shows the content
2014-07-13 09:54:21 +02:00
- `.collapsing` is added when the transition starts, and removed when it finishes
2016-12-20 06:37:09 +01:00
These classes can be found in `_transitions.scss` .
2014-03-17 03:03:53 +01:00
2014-07-13 09:54:21 +02:00
### Via data attributes
2017-06-14 13:21:49 +02:00
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of one or more collapsible elements. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `show` .
2014-07-13 09:54:21 +02:00
2017-03-23 21:15:41 +01:00
To add accordion-like group management to a collapsible area, add the data attribute `data-parent="#selector"` . Refer to the demo to see this in action.
2014-07-13 09:54:21 +02:00
### Via JavaScript
Enable manually with:
2014-03-17 03:03:53 +01:00
2019-01-08 17:33:28 +01:00
{{< highlight js > }}
2019-05-14 11:46:25 +02:00
var collapseElementList = [].slice.call(document.querySelectorAll('.collapse'))
var collapseList = collapseElementList.map(function (collapseEl) {
return new bootstrap.Collapse(collapseEl)
})
2019-01-08 17:33:28 +01:00
{{< / highlight > }}
2014-03-17 03:03:53 +01:00
2014-07-13 09:54:21 +02:00
### Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-` , as in `data-parent=""` .
v5: Forms update (#28450)
* Initial spike of consolidated form checks
* Stub out forms rearrangement
- Prepping to drop non-custom file and range inputs
- Prepping to merge custom and native checks and radios (with switches)
- Prepping to merge custom select with form select
- Moving docs arround so forms has it's own area given volume of CSS
* Move input group Sass file to forms subdir
* Start to split and move the docs around
* Simpler imports
* Copyediting
* delete overview file
* Remove commented out code
* remove the custom-forms import
* rewrite flex-check as form-check, replace all custom properties
* Remove old forms doc
* stub out new subpage link section
* update migration guide
* Update nav, forms overview in page nav, and descriptions
* fix check bg position
* fix margin-top calculation
* rename .custom-select to .form-select
* Update validation styles for new checks
* add some vertical margin, fix inline checks
* fix docs examples
* better way to do this contents stuff, redo the toc while i'm at it
* page restyle for docs while here
* un-callout that, edit text
* redo padding on toc
* fix toc
* start to cleanup checks docs
* Rewrite Markdown tables into HTML
* Redesign tables, redo their docs
* Replace Open Iconic icons with custom Bootstrap icons
* Redesign the docs navbar, add a subheader, redo the sidebar
* Redesign docs homepage a bit
* Simplify table style overrides for docs tables
* Simplify docs typography for page titles and reading line length
* Stub out icons page
* Part of sidebar update, remove migration from nav.yml
* Move toc CSS to separate partial
* Change appearance of overview page
* fix sidebar arrow direction
* Add footer to docs layout
* Update descriptions
* Drop the .form-group class for margin utilities
* Remove lingering form-group-margin-bottom var
* improve footer spacing
* add headings to range page
* uncomment form range css
* Rename .custom-range to .form-range
* Drop unused docs var
* Uncomment the comment
* Remove unused variable
* Fix radio image sizing
* Reboot update: reset horizontal ul and ol padding
* de-dupe IDs
* tweak toc styles
* nvm, fix dropdown versions stuff
* remove sidebar nav toggle for now
* broken html
* fix more broken html, move css
* scss linting
* comment out broken helper docs
* scope styles
* scope styles
* Fixes #25540 and fixes #26407 for v5 only
* Update sidebar once more
* Match new sidenav order
* fix syntax error
* Rename custom-file to form-file, update paths, update migration docs for previous changes in #28696
* rename back
* fix size and alignment
* rename that back too
2019-07-12 23:52:33 +02:00
< table class = "table" >
2017-01-01 01:12:28 +01:00
< thead >
2017-04-28 00:57:10 +02:00
< tr >
< th style = "width: 100px;" > Name< / th >
< th style = "width: 50px;" > Type< / th >
< th style = "width: 50px;" > Default< / th >
< th > Description< / th >
< / tr >
2017-01-01 01:12:28 +01:00
< / thead >
< tbody >
2017-04-28 00:57:10 +02:00
< tr >
< td > parent< / td >
2017-09-25 12:41:54 +02:00
< td > selector | jQuery object | DOM element < / td >
2017-04-28 00:57:10 +02:00
< td > false< / td >
2017-09-25 12:41:54 +02:00
< td > If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the < code > card< / code > class). The attribute has to be set on the target collapsible area.< / td >
2017-04-28 00:57:10 +02:00
< / tr >
< tr >
< td > toggle< / td >
< td > boolean< / td >
< td > true< / td >
< td > Toggles the collapsible element on invocation< / td >
< / tr >
2017-01-01 01:12:28 +01:00
< / tbody >
< / table >
2014-07-13 09:54:21 +02:00
### Methods
2019-01-08 17:33:28 +01:00
{{< callout danger > }}
{{< partial " callout-danger-async-methods . md " > }}
{{< / callout > }}
2017-03-28 23:43:16 +02:00
2014-07-13 09:54:21 +02:00
Activates your content as a collapsible element. Accepts an optional options `object` .
2018-09-15 13:44:23 +02:00
You can create a collapse instance with the constructor, for example:
2019-01-08 17:33:28 +01:00
{{< highlight js > }}
2018-09-15 13:44:23 +02:00
var myCollapse = document.getElementById('myCollapse')
var bsCollapse = new bootstrap.Collapse(myCollapse, {
2014-03-17 03:03:53 +01:00
toggle: false
})
2019-01-08 17:33:28 +01:00
{{< / highlight > }}
2014-03-17 03:03:53 +01:00
v5: Forms update (#28450)
* Initial spike of consolidated form checks
* Stub out forms rearrangement
- Prepping to drop non-custom file and range inputs
- Prepping to merge custom and native checks and radios (with switches)
- Prepping to merge custom select with form select
- Moving docs arround so forms has it's own area given volume of CSS
* Move input group Sass file to forms subdir
* Start to split and move the docs around
* Simpler imports
* Copyediting
* delete overview file
* Remove commented out code
* remove the custom-forms import
* rewrite flex-check as form-check, replace all custom properties
* Remove old forms doc
* stub out new subpage link section
* update migration guide
* Update nav, forms overview in page nav, and descriptions
* fix check bg position
* fix margin-top calculation
* rename .custom-select to .form-select
* Update validation styles for new checks
* add some vertical margin, fix inline checks
* fix docs examples
* better way to do this contents stuff, redo the toc while i'm at it
* page restyle for docs while here
* un-callout that, edit text
* redo padding on toc
* fix toc
* start to cleanup checks docs
* Rewrite Markdown tables into HTML
* Redesign tables, redo their docs
* Replace Open Iconic icons with custom Bootstrap icons
* Redesign the docs navbar, add a subheader, redo the sidebar
* Redesign docs homepage a bit
* Simplify table style overrides for docs tables
* Simplify docs typography for page titles and reading line length
* Stub out icons page
* Part of sidebar update, remove migration from nav.yml
* Move toc CSS to separate partial
* Change appearance of overview page
* fix sidebar arrow direction
* Add footer to docs layout
* Update descriptions
* Drop the .form-group class for margin utilities
* Remove lingering form-group-margin-bottom var
* improve footer spacing
* add headings to range page
* uncomment form range css
* Rename .custom-range to .form-range
* Drop unused docs var
* Uncomment the comment
* Remove unused variable
* Fix radio image sizing
* Reboot update: reset horizontal ul and ol padding
* de-dupe IDs
* tweak toc styles
* nvm, fix dropdown versions stuff
* remove sidebar nav toggle for now
* broken html
* fix more broken html, move css
* scss linting
* comment out broken helper docs
* scope styles
* scope styles
* Fixes #25540 and fixes #26407 for v5 only
* Update sidebar once more
* Match new sidenav order
* fix syntax error
* Rename custom-file to form-file, update paths, update migration docs for previous changes in #28696
* rename back
* fix size and alignment
* rename that back too
2019-07-12 23:52:33 +02:00
< table class = "table" >
< thead >
< tr >
< th > Method< / th >
< th > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td > < code > toggle< / code > < / td >
< td > Toggles a collapsible element to shown or hidden. < strong > Returns to the caller before the collapsible element has actually been shown or hidden< / strong > (i.e. before the < code > shown.bs.collapse< / code > or < code > hidden.bs.collapse< / code > event occurs).< / td >
< / tr >
< tr >
< td > < code > show< / code > < / td >
< td > Shows a collapsible element. < strong > Returns to the caller before the collapsible element has actually been shown< / strong > (e.g., before the < code > shown.bs.collapse< / code > event occurs). < / td >
< / tr >
< tr >
< td > < code > hide< / code > < / td >
< td > Hides a collapsible element. < strong > Returns to the caller before the collapsible element has actually been hidden< / strong > (e.g., before the < code > hidden.bs.collapse< / code > event occurs).< / td >
< / tr >
< tr >
< td > < code > dispose< / code > < / td >
< td > Destroys an element's collapse.< / td >
< / tr >
< tr >
2019-07-28 15:24:46 +02:00
< td > < code > getInstance< / code > < / td >
v5: Forms update (#28450)
* Initial spike of consolidated form checks
* Stub out forms rearrangement
- Prepping to drop non-custom file and range inputs
- Prepping to merge custom and native checks and radios (with switches)
- Prepping to merge custom select with form select
- Moving docs arround so forms has it's own area given volume of CSS
* Move input group Sass file to forms subdir
* Start to split and move the docs around
* Simpler imports
* Copyediting
* delete overview file
* Remove commented out code
* remove the custom-forms import
* rewrite flex-check as form-check, replace all custom properties
* Remove old forms doc
* stub out new subpage link section
* update migration guide
* Update nav, forms overview in page nav, and descriptions
* fix check bg position
* fix margin-top calculation
* rename .custom-select to .form-select
* Update validation styles for new checks
* add some vertical margin, fix inline checks
* fix docs examples
* better way to do this contents stuff, redo the toc while i'm at it
* page restyle for docs while here
* un-callout that, edit text
* redo padding on toc
* fix toc
* start to cleanup checks docs
* Rewrite Markdown tables into HTML
* Redesign tables, redo their docs
* Replace Open Iconic icons with custom Bootstrap icons
* Redesign the docs navbar, add a subheader, redo the sidebar
* Redesign docs homepage a bit
* Simplify table style overrides for docs tables
* Simplify docs typography for page titles and reading line length
* Stub out icons page
* Part of sidebar update, remove migration from nav.yml
* Move toc CSS to separate partial
* Change appearance of overview page
* fix sidebar arrow direction
* Add footer to docs layout
* Update descriptions
* Drop the .form-group class for margin utilities
* Remove lingering form-group-margin-bottom var
* improve footer spacing
* add headings to range page
* uncomment form range css
* Rename .custom-range to .form-range
* Drop unused docs var
* Uncomment the comment
* Remove unused variable
* Fix radio image sizing
* Reboot update: reset horizontal ul and ol padding
* de-dupe IDs
* tweak toc styles
* nvm, fix dropdown versions stuff
* remove sidebar nav toggle for now
* broken html
* fix more broken html, move css
* scss linting
* comment out broken helper docs
* scope styles
* scope styles
* Fixes #25540 and fixes #26407 for v5 only
* Update sidebar once more
* Match new sidenav order
* fix syntax error
* Rename custom-file to form-file, update paths, update migration docs for previous changes in #28696
* rename back
* fix size and alignment
* rename that back too
2019-07-12 23:52:33 +02:00
< td > Static method which allows you to get the collapse instance associated with a DOM element.< / td >
< / tr >
< / tbody >
< / table >
2017-10-16 16:51:42 +02:00
2014-07-13 09:54:21 +02:00
### Events
Bootstrap's collapse class exposes a few events for hooking into collapse functionality.
v5: Forms update (#28450)
* Initial spike of consolidated form checks
* Stub out forms rearrangement
- Prepping to drop non-custom file and range inputs
- Prepping to merge custom and native checks and radios (with switches)
- Prepping to merge custom select with form select
- Moving docs arround so forms has it's own area given volume of CSS
* Move input group Sass file to forms subdir
* Start to split and move the docs around
* Simpler imports
* Copyediting
* delete overview file
* Remove commented out code
* remove the custom-forms import
* rewrite flex-check as form-check, replace all custom properties
* Remove old forms doc
* stub out new subpage link section
* update migration guide
* Update nav, forms overview in page nav, and descriptions
* fix check bg position
* fix margin-top calculation
* rename .custom-select to .form-select
* Update validation styles for new checks
* add some vertical margin, fix inline checks
* fix docs examples
* better way to do this contents stuff, redo the toc while i'm at it
* page restyle for docs while here
* un-callout that, edit text
* redo padding on toc
* fix toc
* start to cleanup checks docs
* Rewrite Markdown tables into HTML
* Redesign tables, redo their docs
* Replace Open Iconic icons with custom Bootstrap icons
* Redesign the docs navbar, add a subheader, redo the sidebar
* Redesign docs homepage a bit
* Simplify table style overrides for docs tables
* Simplify docs typography for page titles and reading line length
* Stub out icons page
* Part of sidebar update, remove migration from nav.yml
* Move toc CSS to separate partial
* Change appearance of overview page
* fix sidebar arrow direction
* Add footer to docs layout
* Update descriptions
* Drop the .form-group class for margin utilities
* Remove lingering form-group-margin-bottom var
* improve footer spacing
* add headings to range page
* uncomment form range css
* Rename .custom-range to .form-range
* Drop unused docs var
* Uncomment the comment
* Remove unused variable
* Fix radio image sizing
* Reboot update: reset horizontal ul and ol padding
* de-dupe IDs
* tweak toc styles
* nvm, fix dropdown versions stuff
* remove sidebar nav toggle for now
* broken html
* fix more broken html, move css
* scss linting
* comment out broken helper docs
* scope styles
* scope styles
* Fixes #25540 and fixes #26407 for v5 only
* Update sidebar once more
* Match new sidenav order
* fix syntax error
* Rename custom-file to form-file, update paths, update migration docs for previous changes in #28696
* rename back
* fix size and alignment
* rename that back too
2019-07-12 23:52:33 +02:00
< table class = "table" >
2017-01-01 01:12:28 +01:00
< thead >
2017-04-28 00:57:10 +02:00
< tr >
v5: Forms update (#28450)
* Initial spike of consolidated form checks
* Stub out forms rearrangement
- Prepping to drop non-custom file and range inputs
- Prepping to merge custom and native checks and radios (with switches)
- Prepping to merge custom select with form select
- Moving docs arround so forms has it's own area given volume of CSS
* Move input group Sass file to forms subdir
* Start to split and move the docs around
* Simpler imports
* Copyediting
* delete overview file
* Remove commented out code
* remove the custom-forms import
* rewrite flex-check as form-check, replace all custom properties
* Remove old forms doc
* stub out new subpage link section
* update migration guide
* Update nav, forms overview in page nav, and descriptions
* fix check bg position
* fix margin-top calculation
* rename .custom-select to .form-select
* Update validation styles for new checks
* add some vertical margin, fix inline checks
* fix docs examples
* better way to do this contents stuff, redo the toc while i'm at it
* page restyle for docs while here
* un-callout that, edit text
* redo padding on toc
* fix toc
* start to cleanup checks docs
* Rewrite Markdown tables into HTML
* Redesign tables, redo their docs
* Replace Open Iconic icons with custom Bootstrap icons
* Redesign the docs navbar, add a subheader, redo the sidebar
* Redesign docs homepage a bit
* Simplify table style overrides for docs tables
* Simplify docs typography for page titles and reading line length
* Stub out icons page
* Part of sidebar update, remove migration from nav.yml
* Move toc CSS to separate partial
* Change appearance of overview page
* fix sidebar arrow direction
* Add footer to docs layout
* Update descriptions
* Drop the .form-group class for margin utilities
* Remove lingering form-group-margin-bottom var
* improve footer spacing
* add headings to range page
* uncomment form range css
* Rename .custom-range to .form-range
* Drop unused docs var
* Uncomment the comment
* Remove unused variable
* Fix radio image sizing
* Reboot update: reset horizontal ul and ol padding
* de-dupe IDs
* tweak toc styles
* nvm, fix dropdown versions stuff
* remove sidebar nav toggle for now
* broken html
* fix more broken html, move css
* scss linting
* comment out broken helper docs
* scope styles
* scope styles
* Fixes #25540 and fixes #26407 for v5 only
* Update sidebar once more
* Match new sidenav order
* fix syntax error
* Rename custom-file to form-file, update paths, update migration docs for previous changes in #28696
* rename back
* fix size and alignment
* rename that back too
2019-07-12 23:52:33 +02:00
< th style = "width: 150px;" > Event type< / th >
2017-04-28 00:57:10 +02:00
< th > Description< / th >
< / tr >
2017-01-01 01:12:28 +01:00
< / thead >
< tbody >
2017-04-28 00:57:10 +02:00
< tr >
< td > show.bs.collapse< / td >
< td > This event fires immediately when the < code > show< / code > instance method is called.< / td >
< / tr >
< tr >
< td > shown.bs.collapse< / td >
< td > This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete).< / td >
< / tr >
< tr >
< td > hide.bs.collapse< / td >
< td > This event is fired immediately when the < code > hide< / code > method has been called.< / td >
< / tr >
< tr >
< td > hidden.bs.collapse< / td >
< td > This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete).< / td >
< / tr >
2017-01-01 01:12:28 +01:00
< / tbody >
< / table >
2014-07-13 09:54:21 +02:00
2019-01-08 17:33:28 +01:00
{{< highlight js > }}
2019-05-14 11:46:25 +02:00
var myCollapsible = document.getElementById('myCollapsible')
myCollapsible.addEventListener('hidden.bs.collapse', function () {
2019-02-10 21:25:51 +01:00
// do something...
2014-03-17 03:03:53 +01:00
})
2019-01-08 17:33:28 +01:00
{{< / highlight > }}