1.0.1 • Published 3 years ago
truncate-string-react v1.0.1
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 |