Ellipsed is a JavaScript plugin for generating multi-lined ellipsed text. It provides the ability to specify the number of lines visible.
You can see the example here: https://nzambello.github.io/ellipsed/
The example/ directory of this repo contains the demo showed above.
To start it on your local machine, clone the repository and install it by following the installation instructions below, then start it with npm start
(or with yarn start
).
# Yarn
yarn add ellipsed
# NPM
npm install --save ellipsed
# Bower
bower install ellipsed
Ellipsed provides a function that is used like this:
ellipsis(selector, rows);
Option | Type | Description |
---|---|---|
selector | string | CSS selector used to target the element |
rows | int | Number of rows that should be visible, following words will be trucated with ... |
Ellipsed is provided as a UMD module.
You can use it as a ES6 module:
import { ellipsis } from 'ellipsed';
As a CommonJS module:
var { ellipsis } = require('ellipsed');
As an AMD module:
require([
'ellipsed'
], function(ellipsed) {
var ellipsis = ellipsed.ellipsis;
});
Or as a global module in the browser:
var ellipsis = window.ellipsed.ellipsis;
New contributors are warmly welcome, see the CONTRIBUTING.md file for other information.