Skip to content

Expandable - Frameworks

Expandable is a layout component used for creating content that can be expanded and collapsed.

AndroidreleasedElementsreleasediOSreleasedReactreleasedVuereleased

Elements

Visual options

Default

html
<w-expandable title="I'm expandable">
  <p>with expanded content</p>
</w-expandable>

Expandable box

html
<w-expandable title="I'm expandable" box>
  <p>with expanded content</p>
</w-expandable>

Expandable box with custom title

This can be used if more control over styling is needed than the title prop allows

html
<w-expandable box>
  <div slot="title" class="flex flex-row items-center">
    <w-icon-bag-16></w-icon-bag-16>
    <p class="ml-8 mb-0">This is a title with an icon</p>
  </div>
  <p>with expanded content</p>
</w-expandable>

With expanded prop

html
<w-expandable box title="I'm expanded by default" expanded>
  <p>content should be visible</p>
</w-expandable>

Props

Optional Props

NameTypeDefaultDescription
expandedbooleanfalseControls component's expanded state
bleedbooleanWill make the expandable full-width on sm-size
boxbooleanfalseWill make the expandable a Box
animatedbooleanfalseWill animate the expansion/collapse
no-chevronbooleanfalseWhether to hide the chevron on the button part of the component
titlestringComponent title. Used to display the title value which is always present regardless of whether the component is open or closed.
heading-levelnumberWrap the toggle button in a heading element with the specified level. If headingLevel is not specified, the button will not be wrapped by a heading element
button-classstringAdditional CSS classes to include on the button part of the component
content-classstringAdditional CSS classes to include on the content part of the component
asstringdivThe DOM element to emit
v-modelbooleanControls the expansion/collapse
chevronbooleantrueControls chevron visibility

Questions?

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system