# @clampy-js/react-clampy

> React component that clamps the content of an element by adding an ellipsis to it if the content inside is too long.

Latest version **1.3.0** (published 2020-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @clampy-js/react-clampy
pnpm add @clampy-js/react-clampy
yarn add @clampy-js/react-clampy
bun add @clampy-js/react-clampy
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2020-07-13 |
| First published | 2019-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 245.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alexandre Moore |
| Maintainers | alexandre.moore |

## Links

- npm: https://www.npmjs.com/package/@clampy-js/react-clampy
- Repository: https://github.com/clampy-js/react-clampy
- Homepage: https://github.com/clampy-js/react-clampy#readme
- Issues: https://github.com/clampy-js/react-clampy/issues
- npm.io page: https://npm.io/package/@clampy-js/react-clampy

## Dependencies (1)

- [@clampy-js/clampy](https://npm.io/package/@clampy-js/clampy.md) ^1.0.10

## Recent versions

- 1.3.0 (latest) — 2020-07-13
- 1.2.0 — 2019-11-08
- 1.1.0 — 2019-11-08
- 1.0.1 — 2019-09-29
- 1.0.0 — 2019-09-29

## README

# @clampy-js/react-clampy

React component that clamps the content of an element by adding an ellipsis to it if the content inside is too long.

[![Build Status](https://img.shields.io/travis/clampy-js/react-clampy.svg)](https://travis-ci.org/clampy-js/react-clampy)
[![GitHub issues](https://img.shields.io/github/issues/clampy-js/react-clampy.svg)](https://github.com/clampy-js/react-clampy/issues)
[![GitHub license](https://img.shields.io/npm/l/@clampy-js/react-clampy)](https://github.com/clampy-js/react-clampy/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/dt/@clampy-js/react-clampy.svg)](https://www.npmjs.com/package/@clampy-js/react-clampy)

It uses [@clampy-js/clampy](https://github.com/clampy-js/clampy) library (a fork of [Clamp.js](https://github.com/josephschmitt/Clamp.js)) behind the scene to apply the ellipsis.

It automatically re-clamps itself when the element or the browser window change size.

## Install

```bash
npm install --save @clampy-js/react-clampy
```

## Usage

```jsx
import React, { Component } from 'react'

import Clampy from '@clampy-js/react-clampy'

class Clampy extends Component {
  render () {
    return (
      <Clampy clampSize="2">My long text to clamp</Clampy>
    )
  }
}
```

## License

MIT © [alexandremoore](https://github.com/alexandremoore)

---
_Source: https://npm.io/package/@clampy-js/react-clampy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
