1.0.3 • Published 2 years ago

react-clamp-future v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Clamp

This project is simple React version of Vue Clamp

Installation

To install the stable version:

npm install --save react-clamp

Usage

import Clamp from 'react-clamp'

<Clamp
  text='React makes it painless to create interactive UIs.'
  maxLine={2}
/>

Add children render as tail of clamped text

import Clamp from 'react-clamp'

<Clamp
  text='React makes it painless to create interactive UIs.'
  maxLine={2}
>
  <button>New</button>
</Clamp>

SCR-20220724-vx5

Options

text

Type: string Required

The text you want to clamp.

maxLine

Type: number Required

Max count of lines allowed.

Development

Serve with hot reload at localhost:5173:

yarn dev

Build:

yarn build

Todo

  • Build "smooth" version with state instead of using useRef
  • Add more feature
  • Built doc site by e11y/astro
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago