# react-advanced-ellipsis

> Truncate string where you want

Latest version **0.1.0** (published 2022-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-advanced-ellipsis
pnpm add react-advanced-ellipsis
yarn add react-advanced-ellipsis
bun add react-advanced-ellipsis
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-09-28 |
| First published | 2022-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vladimir Ivakin |
| Maintainers | minhir |
| Keywords | react, ellipsis |

## Links

- npm: https://www.npmjs.com/package/react-advanced-ellipsis
- Repository: https://github.com/Minhir/react-advanced-ellipsis
- Issues: https://github.com/Minhir/react-advanced-ellipsis/issues
- npm.io page: https://npm.io/package/react-advanced-ellipsis

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2022-09-28

## README

# React advanced ellipsis

Truncate string where you want and keep it's tail.

Original phrase:

```
I don't love ellipsis
```

Default ellipsis:

```
I don't love ellip...
```

Advanced ellipsis:

```
I do... love ellipsis
```

## How to use

```jsx
import { TailedEllipsis } from "react-advanced-ellipsis";

<TailedEllipsis tailLength={13}>I don't love ellipsis</TailedEllipsis>;
```

Props:

| Prop               | Description                    |
| ------------------ | ------------------------------ |
| children: string   | Text to be truncated           |
| tailLength: number | Length of a non shrinking tail |
| title?: string     | Text title                     |
| className?: string | Text container className       |
|                    |                                |

> NOTE: the library uses ResizeObserver inside. You may need a polyfill for some old browsers.

## How to build the library

```
npm install
npm run build
```

It will produce artifacts into `dist` folder

## How to run storybook

```
npm run storybook
```

---
_Source: https://npm.io/package/react-advanced-ellipsis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
