New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nanoclamp

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoclamp

Responsive text clamping component for React

  • 2.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-98.57%
Maintainers
0
Weekly downloads
 
Created
Source
microlink logo microlink logo

Last version NPM Status

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

proptypedefaultdescription
accessibilitybooleantruePass the full unclamped string to the DOM element's title attribute
classNamestringCSS classname(s) added to the string
debouncenumber300Time in milliseconds used for debounce
ellipsisstring'…'String displayed after the clamped text
isstring'div'DOM selector used to render the string
linesnumber3Number of visible lines
textstringText 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

Keywords

FAQs

Package last updated on 07 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc