Naughty Program Manipulator

    react-clampio

    0.1.0 • Public • Published

    react-clampio

    React component for clamping lines. It adds ellipsis if text exceeds the defined max lines value

    Getting started

    Install package using yarn or npm

    $ yarn add react-clampio
    
    $ npm install react-clampio --save
    

    Pass to the component text that should be truncated:

    import Clampio from 'react-clampio';
     
    ...
     
    const longText = 'Lorem ipsum ...';
    <Clampio
      text={longText}
      lines={3}
    />

    Props

    Name Type Required Description
    text string true Text to truncate
    lines number false Maximum lines (default 2)
    ellipsis string fasle Symbol at the end of truncated text (default ...)
    className string false Custom classname

    Install

    npm i react-clampio

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    ISC

    Unpacked Size

    8.85 kB

    Total Files

    4

    Last publish

    Collaborators

    • ok2ju