Materialish

Expansion Panel

Expansion panels allow you to place details in a container that is initially hidden, but can be opened by the user.

🙌 Heads up! This code is editable. The preview above will update to reflect your changes.

Usage

import { ExpansionPanel } from 'materialish';
import 'materialish/materialish.css';

ExpansionPanel

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the menu
openfalseWhether or not this ExpansionPanel is expanded
childrenA single ExpansionPanel.Header and a single ExpansionPanel.Body
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element

CSS Variables

VariableDefault ValueDescription
--mt-baseFontSize1remThe size of text within the menu
--mt-fontFamily'Roboto'The font family to use for text

ExpansionPanel.Header

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the panel header
childrenThe content to display in the header of the expansion panel
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the panel header

ExpansionPanel.Body

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the panel body
childrenThe content to display in the body of the expansion panel
openinheritedWhether or not the panel is open. This value is inherited from the parent, so you do not need to provide it.
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the panel body

Useful Links