Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

doyeonOh/ngx-line-clamp

Repository files navigation

NgxLineClamp

angular simple line clamp. inspired by line-clamp. working fine on responsive UI. example

Install

npm install ngx-line-clamp

Import

import { NgxLineClampModule } from 'ngx-line-clamp';

@NgModule({
  ...
  imports: [
    ...,
    NgxLineClampModule
  ]
})

Usage

<div style="height: 100px;">
  <div ngxLineClamp [text]="text">
  </div>
</div>

input

option description
text (required) Text to use in line clamp div.
lineCount (option) Maximum number of lines
parentElement (option) A parent element with a maximum size that can extend the line clamp. (default: ngxLineClamp wrapper)
ellipsis (option) Abbreviation display character. (default: ...)

output

textTruncated called when text was truncated

License

MIT

About

Line clamp a DOM element in Angular

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published