nikolas-sapa

Truncation Word Count

Text

About

A line-clamp text component that shows the exact number of hidden words behind a "+ N words" control instead of a vague ellipsis, with a dashed fade edge and a smooth expand animation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Truncation Word Count to your project and fits it to your theme.

Code

How Truncation Word Count is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import SelvageFold from "@/components/ui/truncation-word-count";

export default function Demo() {
  return (
    <div className="mx-auto max-w-md p-8">
      <SelvageFold lines={3}>
        The quick brown fox jumps over the lazy dog. This sentence is often used
        to test typefaces and keyboards because it contains every letter of the
        English alphabet. Typography nerds have repeated it for over a century,
        and it still shows up in demos, specimen sheets, and font previews
        today. Truncation that tells the truth is rare: most read-more controls
        hide an unknown amount of text behind an ellipsis, leaving readers to
        guess whether they are missing a sentence or a whole paragraph. This
        component measures exactly how many words are hidden and says so
        plainly.
      </SelvageFold>
    </div>
  );
}

More by nikolas-sapa

View all
  • Countdown Vapor Digits

    Countdown Vapor Digits

    190
  • Dye Whorl

    Dye Whorl

    167
  • Background ASCII Wake

    Background ASCII Wake

    92
  • Hero Burin Hatch

    Hero Burin Hatch

    79
  • Hero ASCII Schlieren

    Hero ASCII Schlieren

    64
  • Hero ASCII Reaction Front

    Hero ASCII Reaction Front

    61
  • Hero Text Ring Funnel

    Hero Text Ring Funnel

    60
  • Toast Gravity Stack

    Toast Gravity Stack

    58

More in Text

View all
  • Motion Blur Text

    Motion Blur Text

    45
  • Rainbow Text Effect

    Rainbow Text Effect

    58
  • Text Reveal

    Text Reveal

    29
  • Blur Reveal

    Blur Reveal

    73
  • Short Slide Down

    Short Slide Down

    45
  • Apple Hello Effect

    Apple Hello Effect

    659
  • Scroll Fill Headline

    Scroll Fill Headline

    14
  • Blur Reveal

    Blur Reveal

    364