Skip to content

definite2/truncate-middle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculating Number of Characters Fit Into HTML Element

This project includes two custom hooks to calculate the maximum number of characters that can fit into a given html element.

The purpose is if the text width is larger than its contianer element, i.e. button, the extra text is truncated from middle with ellipsis.

For example, suppose original text is : 'longer text button', and suppose the container element's content width is 128px, then the result will be : 'longer...button'

Blog

For more explanation, please read this blog

Demo

See demo

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published