@@ -10,6 +10,8 @@ import BasicExample from "@components/examples/collapsible/BasicExample.astro";
1010import ActionsExample from " @components/examples/collapsible/ActionsExample.astro" ;
1111import DecorationsExample from " @components/examples/collapsible/DecorationsExample.astro" ;
1212import ScrollableExample from " @components/examples/collapsible/ScrollableExample.astro" ;
13+ import ToggleExample from " @components/examples/collapsible/ToggleExample.astro" ;
14+ import CssBodyPartExample from " @components/examples/collapsible/CssBodyPartExample.astro" ;
1315
1416<Imports />
1517<PageSwitcher />
@@ -37,6 +39,30 @@ import ScrollableExample from "@components/examples/collapsible/ScrollableExampl
3739 </Fragment >
3840</Demo >
3941
42+ ## Toggle event
43+
44+ A custom event is dispatched when the visibility of content changes.
45+
46+ <Demo >
47+ <ToggleExample />
48+ <Fragment slot = " html" >
49+ ``` html
50+ <vscode-collapsible title =" Dispatch toggle event" id =" toggle-event-example" >
51+ <p >Test content</p >
52+ </vscode-collapsible >
53+ ```
54+ </Fragment >
55+ <Fragment slot = " js" >
56+ ``` javascript
57+ const el = document .querySelector (" #toggle-event-example" );
58+
59+ el .addEventListener (" vsc-collapsible-toggle" , (ev ) => {
60+ console .log (ev);
61+ });
62+ ```
63+ </Fragment >
64+ </Demo >
65+
4066## Actions
4167
4268Clickable action icons. Please review the developer console for logged messages. These icons are
@@ -138,6 +164,43 @@ Elements in the `decorations` slot are always visible, in contrast to the `actio
138164 </Fragment >
139165</Demo >
140166
167+ ## Overflown content
168+
169+ The overflown content of the Collapsible component is hidden by default. Sometimes, this behavior
170+ can be problematic. In such cases, it is useful that the Collapsible body is customizable.
171+
172+ <Demo >
173+ <CssBodyPartExample />
174+ <Fragment slot = " html" >
175+ ``` html
176+ <vscode-collapsible title =" Customized CSS part example" class =" css-part-example" open >
177+ <p >Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p >
178+ <vscode-single-select >
179+ <vscode-option >Lorem</vscode-option >
180+ <vscode-option >Ipsum</vscode-option >
181+ <vscode-option >Dolor</vscode-option >
182+ <vscode-option >Sit</vscode-option >
183+ <vscode-option >Et</vscode-option >
184+ <vscode-option >Amur</vscode-option >
185+ <vscode-option >Sadispcing</vscode-option >
186+ </vscode-single-select >
187+ <p >Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p >
188+ </vscode-collapsible >
189+ ```
190+ </Fragment >
191+ <Fragment slot = " css" >
192+ ``` css
193+ .css-part-example ::part(body ) {
194+ overflow : visible ;
195+ }
196+
197+ .css-part-example p :last-child {
198+ margin-bottom : 0 ;
199+ }
200+ ```
201+ </Fragment >
202+ </Demo >
203+
141204## Displaying large amounts of data
142205
143206Long content can be managed by the [ Scrollable] ( /components/scrollable ) component.
0 commit comments