0.2.0 • Published 5 years ago

@crossfield/react-read-more v0.2.0

Weekly downloads
506
License
MIT
Repository
-
Last release
5 years ago

Read more

demo

npm install @crossfield/react-read-more

This read more component helps truncate large chunks of text/html and animates to the full height of the inner content.

Example

<ReadMore
  initialHeight={350}
  readMore={props => (
    <ReadMoreButton onClick={props.onClick}>
      {props.open ? 'Read Less' : 'Read More'}
      <Icon
      name="caret"
      style={{
        transform: `rotate( ${props.open ? '-90deg' : '90deg'})`,
        transition: 'transform 0.25s',
      }}
      />
    </ReadMoreButton>
  )}
>
  <Label>The Design Vision</Label>
  <Text>
      SOME LONG TEXT
  </Text>
</ReadMore>

Props

initialHeight

The closed size of the container

readMore

render function that gives you a props object containing open and onClick to toggle open / close

0.2.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago