Need help with react-truncate-string?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

albinotonnina
124 Stars 7 Forks Apache License 2.0 30 Commits 19 Opened issues

Description

Truncate strings like butter.

Services available

!
?

Need anything else?

Contributors list

# 60,385
Markdow...
vanilla...
Webpack
animate...
28 commits
# 428,433
React
HTML
truncat...
Python
1 commit
# 442,267
JavaScr...
React
HTML
truncat...
1 commit

React Truncate String

Truncate strings like butter.

Build Status

Features

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

Requirements

This library relies on spaces for truncation. Thanks @dschinkel for pointing that out.

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 © 2020 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.