Skip to main content

ExpandableText

The ExpandableText component provides expand and collapse functionality for inline text.

Import

import { ExpandableText } from '@dynatrace/strato-components-preview/content';

Use cases

CodeSandbox

Expand text by default

Use the defaultExpanded prop to initially expand the text.

CodeSandbox

Customize the Button

Use the expandLabel and collapseLabel props to set a custom label for the expand and collapse buttons respectively.

CodeSandbox

Props

ExpandableTextProps

Signature:

export declare type ExpandableTextProps = & ( | );

ExpandableTextBaseProps

extends, ,
NameTypeDefaultDescription
expandLabel?
'Show more'Text shown for expanding the content.
collapseLabel?
'Show less'Text shown for collapsing the content.

ExpandableTextControlledProps

NameTypeDefaultDescription
expanded
-Determines whether or not the content is expanded in a controlled scenario.
onExpandChange
(expanded: ) =>
-Callback fired when the expanded attribute changes in a controlled scenario.

ExpandableTextUncontrolledProps

NameTypeDefaultDescription
defaultExpanded?
falseDetermines whether or not the content is initially expanded in an uncontrolled scenario.
Still have questions?
Find answers in the Dynatrace Community