x-lines

Crop your text to fit it into X lines. View demo

Usage no npm install needed!

<script type="module">
  import xLines from 'https://cdn.skypack.dev/x-lines';
</script>

README

x-lines

Crop your text to fit it into X lines.
View demo

Installation

npm i x-lines   # or yarn add x-lines

Usage

Vanilla

import { initCropper } from "x-lines"

const el = document.getElementById("foobar")

initCropper({ el, lines: 2 })

Vue directive

<template>
  <div v-crop-lines="2">Hello world</div>
</template>

<script>
import { cropLinesDirective } from "x-lines/vue"

export default {
  directives: {
    cropLines: cropLinesDirective
  }
}
</script>