raster-foundry / blasterjs

React UI library designed and built by Azavea
https://raster-foundry-blaster.netlify.com
Other
6 stars 3 forks source link

Build-in text truncation #230

Closed alkamin closed 4 years ago

alkamin commented 5 years ago

New component name: Depending on implementation, this might be Truncate. It could also get implemented as a prop on text-based components backed by some utility functions.

Package this component should live in: Core

Context Using this component or prop would allow the user to set the max-width of text with the expectation that overflow would be hidden and ellipses would be added to the end.

alkamin commented 4 years ago

https://polished.js.org/docs/#ellipsis

Seems like this would do the job just fine without adding our own maintenance overhead.