npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dead-lock-react-lib

v0.2.2

Published

A collection of React components. Includes Truncate, a text-truncation component that works with Tailwind, plain CSS, or inline styles, with click-to-expand and tooltip support.

Downloads

669

Readme

dead-lock-react-lib

A collection of React components. Starting with Truncate, a single-line-truncating <span> for React with click-to-expand and a hover tooltip. Truncation is driven by inline styles, so it works out of the box — no Tailwind (or any CSS framework) required. Tailwind users can keep using utility classes for everything else via className.

Install

npm install dead-lock-react-lib

Usage

You can import components using named imports:

import { Truncate } from 'dead-lock-react-lib';

<Truncate width={240}>A long string that will be truncated with an ellipsis</Truncate>
<Truncate style={{ maxWidth: '20rem', color: 'crimson' }}>...</Truncate>

Multi-line Clamping (Line Clamp)

You can clamp the text to a specific number of lines before truncating:

<Truncate lines={3} width="300px">
  A very long paragraph of text that will be clamped to exactly three lines before it truncates with an ellipsis.
</Truncate>

Tailwind

<Truncate className="max-w-xs text-sm text-gray-600">
  A long string that will be truncated with an ellipsis
</Truncate>

className, style, and width can be combined; style always has final say over the computed truncation styles, and width becomes maxWidth when neither className nor style already define one.

Props

| Prop | Type | Default | Description | | -------------------- | -------------------- | ------- | -------------------------------------------------------------------------- | | children | ReactNode | — | Content to render/truncate. | | title | string | — | Tooltip shown while truncated. Defaults to the text form of children. | | className | string | — | Tailwind or plain CSS classes. Purely additive. | | classname | string | — | Lowercase alias for className (typo-tolerant). | | style | CSSProperties | — | Inline CSS, merged over the computed truncation styles. | | width | number \| string | — | Truncation width. A number is treated as px. | | lines | number | — | Number of lines to clamp to before truncating. If > 1, multi-line is used.| | noMobileTransform | boolean | false | Below 768px, skip truncation and render the full text. | | whitespace | boolean | false | When truncation is bypassed on mobile, force single-line instead of wrap.| | disableClickExpand | boolean | false | Disable the click-to-expand/collapse interaction. |

Behavior notes

  • Hovering measures overflow; if the text is actually clipped, the element becomes clickable and shows a native tooltip.
  • Clicking a truncated (or expanded) element toggles between the ellipsis view and a fully wrapped, multi-line view.
  • With noMobileTransform, any width limit — from className, style, or width — is dropped on mobile viewports so the text renders naturally.