Skip to content

Expandable text

Pro

Text cut to a few lines with "See more", shown only when it is cut, that expands it in place: posts, comments, reviews and bios. Not an M3 component (@windmorph/react-pro).

import { ExpandableText } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Playground

Phở night at the community hall this Saturday from 6pm. Bring a bowl and a friend: every table is shared, and the broth has been simmering since Friday morning. There is a vegetarian pot too, and the kids’ corner has crafts and lanterns. Parking is behind the church, and the 42 bus stops outside.

Code

import { ExpandableText } from '@windmorph/react-pro'; <ExpandableText  lines={3}  collapsible  className="text-body-large text-on-surface">  Phở night at the community hall this Saturday from 6pm. Bring a bowl and a friend: every table is shared, and the broth has been simmering since Friday morning. There is a vegetarian pot too, and the kids’ corner has crafts and lanterns. Parking is behind the church, and the 42 bus stops outside.</ExpandableText>

Examples

Feed posts

See less, in French

Controlled: expand all