SectionExpandable

There is a breaking change to this component in the next version of NUI Widgets.
import { SectionExpandable } from '@concur/nui-widgets';

The SectionExpandable component is a specialized version of a Section that provides a method for showing or hiding the body content.

Example

<SectionExpandable title='Heading'>
    {paragraph}
</SectionExpandable>

Usage

Properties

Name Type Default Description
children Any Required The “body” of the section; that is, any content that exists outside the <header> element but inside the <section> element.
title String Required Plain text of the section heading. Must not contain only whitespace because concise yet descriptive headings are extremely important to screen readers. If this needs to be visually hidden, set the titleIsHidden property to true.
className String   Sets the class attribute for the entire section: <section class="cnqr-my-class">. If not set, no class attribute will be written: <section>.
expanded Boolean true When false, the children nodes (body content) will be hidden.
headingLevel String 'h2' Sets the semantic heading level for the section heading: <h3>. Allowable values are 'h2' through 'h6'. (<h1> headings are managed by the framework itself.)
iconName String   If set, an icon will be displayed to the left of the title text (and will be visible even when titleIsHidden is true). A list of available icons and their corresponding names can be found at Icons.
titleIsHidden Boolean false If true, the title text will be hidden from sighted readers but will remain accessible to screen readers.

Callbacks

Property Parameters Description
onExpand expanded (Boolean) Callback function when the section is toggled between expanded and collapsed.