Skip to content

When working with react-markdown, is it possible to create a "show more" or "see more" button? #1388

Answered by ChristianMurphy
julillermo asked this question in Q&A
Discussion options

You must be logged in to vote

Welcome @julillermo 👋
Taking a step back, it sounds like you want the clamping to be height based on a screen?
react-markdown doesn't know that, that needs to happen after react-markdown and react have run so the layout engine can determine height.

Depending on you use case you could use pure CSS https://www.sitepoint.com/implementing-show-moreless-functionality-with-pure-css/
Or wrap the content is a show more/less component like https://www.npmjs.com/package/react-show-more-text

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by julillermo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants