Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
Toggle the visibility of content across your project.
The <post-collapsible>
component is used to show and hide content.
Collapsing an element will animate the height from its current value to 0.
Contentus momentus vero siteos et accusam iretea et justo.
<post-collapsible-trigger for="6a91848c-16ec-4a23-bc45-51c797b5b2c3--default"> <button class="btn btn-secondary">Toggle Collapsible</button> </post-collapsible-trigger> <post-collapsible id="6a91848c-16ec-4a23-bc45-51c797b5b2c3--default"> <p class="border rounded p-large">Contentus momentus vero siteos et accusam iretea et justo.</p> </post-collapsible>
Name | Description | Default | Control |
---|---|---|---|
props | |||
collapsed | If true , the element is collapsed otherwise it is displayed.boolean | false | |
events | |||
postToggle | An event emitted when the collapse element is shown or hidden, before the transition. The event payload is a boolean: boolean | - | - |
methods | |||
toggle | Triggers the collapse programmatically. If there is a collapsing transition running already, it will be reversed. toggle(open?: boolean) => Promise<boolean> | - | - |
slots | |||
default | Slot for placing content within the collapsible element. other | - | - |
The following examples show different use cases for the <post-collapsible>
component.
To make the collapsible content hidden by default, just use the collapsible="true"
property.
Contentus momentus vero siteos et accusam iretea et justo.
The <post-collapsible>
component offers a .toggle()
method that allows you to trigger the collapse programmatically.
This method is asynchronous and returns a promise that resolves with the current open state.
It optionally takes a boolean parameter: true
forces it open, and false
forces it closed.
const collapsible = document.querySelector('#collapsibleId') as HTMLPostCollapsibleElement; collapsible.toggle(/* open: boolean */).then((/* isOpen: boolean */) => {});