17.0.0 • Published 1 year ago

ngx-expanding-text v17.0.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

NgxExpandingText

ngx-expanding-text is a component that wraps text and allows it to be expanded or collapsed. It is useful for displaying long text in a limited space.

Preview

Demo App Link

Installation

Run the following command to install the library

npm install ngx-expanding-text

Usage

  1. Import the NgxExpandingTextModule in your module:
import { NgxExpandingTextModule } from 'ngx-expanding-text';

@NgModule({
    declarations: [
        // ...
    ],
    imports: [
        NgxExpandingTextModule
    ],
    providers: [
        //...
    ]
})
  1. Use the ngx-expanding-text component in your template:
<ngx-expanding-text
        [text]="'Your long text goes here...'"
></ngx-expanding-text>

Versions

Angularngx-expanding-text
>=17.0.0 <18.0.0v17.x
>=16.0.0 <17.0.0v16.x
>=15.0.0 <16.0.0v15.x
>=14.0.0 <15.0.0v14.x
>=13.0.0 <14.0.0v13.x
>=12.0.0 <13.0.0v12.x

Configuration

Inputs

InputTypeDefaultRequiredDescription
textstring''yesThe raw text to be displayed in the component.
charCountLimitnumber100noThe character count limit for the collapsed text view.
showEllipsisbooleantruenoWhether to show ellipsis when the text is collapsed.
initiallyExpandedbooleanfalsenoWhether the text should be initially expanded.
moreButtonTextstring'Show More'noThe text for the 'Show More' button.
lessButtonTextstring'Show Less'noThe text for the 'Show Less' button.
moreButtonTemplateTemplateRef<any>nullnoA custom template for the 'Show More' button.
lessButtonTemplateTemplateRef<any>nullnoA custom template for the 'Show Less' button.

Output

Output nameTypeDescription
(toggle)TextToggleEvent {isExpanded: boolean}An event that is emitted when the text is expanded or collapsed.

Methods

Method nameDescription
toggleToggles the expanded/collapsed state of the text.
17.0.0

1 year ago

16.0.0

1 year ago

15.0.0

1 year ago

14.0.0

1 year ago

13.0.1

1 year ago

13.0.0

1 year ago

12.0.0

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago