0.1.1 • Published 2 years ago

@gluedigital/read-more v0.1.1

Weekly downloads
5
License
MIT
Repository
gitlab
Last release
2 years ago

ReadMore

React component for collapsing and expanding a text

Usage

To install it:

npm install --save @gluedigital/read-more

To use it:

import ReadMore from '@gluedigital/read-more'

// ...

<ReadMore
  value={text}
  delimiter={'\n'}
  maxExcerptLength='250'
  messageReadMore={messageReadMore}
  messageReadLess={messageReadLess}
/>

Options

The following props can be used:

NameTypeDescription
valuestringText that you want to show
delimiterstringCharacters that delimit how far the text collapses
maxExcerptLengthstringDefault number by which the text will collapse if you do not find the delimiter
messageReadMorestringMessage displayed when the text is collapsed
messageReadLessstringMessage displayed when the text is expanded

Note The delimiter is replaced by a blank space when the text expands

Developing

This package uses nwb for the build. Take a look at their documentation for more info.

TL;DR: after installing nwb, just do npm start to open the dev environment.

0.1.1

2 years ago

0.1.0

7 years ago