Skip to content

About

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

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

@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 GitHub issues GitHub license npm

It uses @clampy-js/clampy library (a fork of Clamp.js) behind the scene to apply the ellipsis.

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

Install

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

Usage

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

About

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

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages