2.0.9 • Published 1 month ago
nanoclamp v2.0.9
Storybook
Responsive text clamping component. Inspired by react-clamp-lines, but smaller (~1KB).
Install
npm install nanoclamp --save
Usage
import NanoClamp from 'nanoclamp';
<NanoClamp
className="custom-class"
is="p"
lines={2}
text={'Some text to clamp.'}
/>
API
prop | type | default | description |
---|---|---|---|
accessibility | boolean | true | Pass the full unclamped string to the DOM element's title attribute |
className | string | CSS classname(s) added to the string | |
debounce | number | 300 | Time in milliseconds used for debounce |
ellipsis | string | '…' | String displayed after the clamped text |
is | string | 'div' | DOM selector used to render the string |
lines | number | 3 | Number of visible lines |
text | string | Text you wish to clamp |
License
nanoclamp © Microlink, released under the MIT License.
Adapted from react-clamp-lines
by Brad Adams with help from contributors.
microlink.io · GitHub microlinkhq · Twitter @microlinkhq
2.0.9
1 month ago
2.0.8
1 month ago
2.0.7
6 months ago
2.0.6
8 months ago
2.0.5
12 months ago
2.0.3
1 year ago
2.0.2
1 year ago
2.0.4
1 year ago
2.0.1
1 year ago
2.0.0
1 year ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.12
4 years ago
1.2.11
5 years ago
1.2.10
5 years ago
1.2.9
5 years ago
1.2.7
6 years ago
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago