react-truncate-string

by albinotonnina

albinotonnina / react-truncate-string

Truncate strings like butter.

123 Stars 4 Forks Last release: Not found Apache License 2.0 29 Commits 7 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

React Truncate String

Truncate strings like butter.

Build Status

Features

It truncates long long long long...long long strings in the middle!

demo: https://albinotonnina.github.io/react-truncate-string

πŸš€ ultra-blazingly-fast

🌈 ultra-light: 1.76 KB

Table of Contents

Install

yarn add react-truncate-string

Usage

Truncate in the middle of the string

import TruncateString from 'react-truncate-string'

...

render(){

return  <truncatestring text="your long string"></truncatestring>

}

Truncate the string at 90%

import TruncateString from 'react-truncate-string'

...

render(){ return }

Demos

https://albinotonnina.github.io/react-truncate-string

https://codesandbox.io/s/xvv9r5ozo

Maintainers

@albinotonnina

Contribute

PRs accepted.

TODO

  • truncate by words?
  • min start and end characters option?
  • change debounce time with option?

License

MIT Β© 2018 Albino Tonnina

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.