enes

Expander

Control that displays a header and a collapsible content area.

Expander Title A description of the expander

This is the content of the expander.

Expander - Direction: Up

This is the content of the expander.

Disabled Expander

Usage

A basic expander expects a header and its content. You can configure the header by passing the `header` property. Content can be provided as child elements of the component. By default, the content container has no padding, this allows you to use 100% of the content width if needed.

<script>
  import { Expander } from 'fluentui-svelte';
</script>

<Expander header="Expander Title">
  <p>This is the content of the expander</p>
</Expander>

Component API

A brief explanation of the props that really need explaining. You can see the rest of the props here.

Controlling Expansion

Expanders can be either expanded or collapsed. This can be controlled by setting the `expanded` property.

Expander Title

This is the content of the expander

Opening Direction

An expander doesn’t have to expand downwards. You can control an expander’s expansion direction using the `direction` property. To create an upwards-expanding expander, set `direction` to `up`.

Expander Title

This is the content of the expander

Adding an Icon

You can easily add an icon to an expander’s header using the `Icon` prop. You can pass either a Snippet or a Component.

Expander With Icon

This is the content of the expander

Component Props

NameTypeDescription
headerstringLabel of the expander.
descriptionstringDescription to render below the header.
directionstringThe opening direction of the expander. Possible values: `'down'`, `'up'`.
justifybooleanWhether the expander is justified to the full width of the container.
disabledbooleanDisables the user interaction.
animationobjectThe animation configuration.
expandedbooleanControls the opening state of the expander.
elementHTMLDetailsElementThe DOM reference of the expander element.
IconSnippet | ComponentThe icon to display before the label.
childrenSnippetThe children elements to render inside the expander.