truncate-string-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

React Truncate String

Customizable React component for truncating your string.

Installation

npm:

npm install truncate-string-react

Example

import React from "react";
import TruncateString from "truncate-string-react";

export default App function() {
    return (
        <TruncateString
            string="This is the truncated string, Enjoy Guys"
            length={10}
            typeCount={4}
            type="."
        />
    );
  }
};

Options

Prop Type Description Default
string String The input text to truncate. '-'
length Object The length of the truncated string. length of your string
type String The type of the element which will be show after truncated string. '.'
typeCount Object The number of type which will be show after truncated string. 3

Liscence

Anzil Sulthan

Package Sidebar

Install

npm i truncate-string-react

Weekly Downloads

17

Version

1.0.1

License

MIT

Unpacked Size

3.25 kB

Total Files

5

Last publish

Collaborators

  • ansul