2.0.12 • Published 1 year ago
nanoclamp v2.0.12
Storybook
Responsive text clamping component. Inspired by react-clamp-lines, but smaller (~1KB).
Install
npm install nanoclamp --saveUsage
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.11
1 year ago
2.0.12
1 year ago
2.0.10
2 years ago
2.0.9
2 years ago
2.0.8
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.5
3 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.4
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.4
6 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.12
6 years ago
1.2.11
7 years ago
1.2.10
7 years ago
1.2.9
7 years ago
1.2.7
8 years ago
1.2.6
8 years ago
1.2.5
8 years ago
1.2.4
8 years ago
1.2.3
8 years ago
1.2.2
8 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.4
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago