You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@tailwindcss/line-clamp

Package Overview
Dependencies
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tailwindcss/line-clamp

A plugin that provides utilities for visually truncating text after a fixed number of lines.

0.4.4
latest
Source
npm
Version published
Weekly downloads
486K
1.12%
Maintainers
5
Weekly downloads
 
Created

What is @tailwindcss/line-clamp?

@tailwindcss/line-clamp is a Tailwind CSS plugin that provides utilities for visually truncating text after a fixed number of lines. This is particularly useful for creating clean and consistent layouts where text content needs to be limited to a certain number of lines.

What are @tailwindcss/line-clamp's main functionalities?

Basic Line Clamping

This feature allows you to truncate text after a specified number of lines. In this example, the text will be truncated after 3 lines.

<div class="line-clamp-3">
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>

Responsive Line Clamping

This feature allows you to apply different line clamping rules at different breakpoints. In this example, the text will be truncated after 2 lines on small screens, 4 lines on medium screens, and 6 lines on large screens.

<div class="line-clamp-2 md:line-clamp-4 lg:line-clamp-6">
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>

Other packages similar to @tailwindcss/line-clamp

FAQs

Package last updated on 30 Mar 2023

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