# react-showhide-component

> React component for view more/view less functionalities.

Latest version **1.0.2** (published 2018-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-showhide-component
pnpm add react-showhide-component
yarn add react-showhide-component
bun add react-showhide-component
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-07-27 |
| First published | 2018-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | https://github.com/vaibhavdiwani |
| Maintainers | vaibhav_patel |
| Keywords | react, show more, show less, ellipsis, multiline, show more element, show less element, show text, hide text |

## Links

- npm: https://www.npmjs.com/package/react-showhide-component
- Repository: https://github.com/vaibhavdiwani/react-showhide-component
- Homepage: https://github.com/vaibhavdiwani/react-showhide-component#readme
- Issues: https://github.com/vaibhavdiwani/react-showhide-component/issues
- npm.io page: https://npm.io/package/react-showhide-component

## Dependencies (1)

- [react-truncate](https://npm.io/package/react-truncate.md) 2.3.0

## 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

- 1.0.2 (latest) — 2018-07-27
- 1.0.1 — 2018-07-27
- 1.0.0 — 2018-07-27

## README

# react-showhide-component

>

[![NPM](https://img.shields.io/npm/v/react-showhide-component.svg)](https://www.npmjs.com/package/react-showhide-component) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

Using npm:

```bash
npm install --save react-showhide-component
```

or using yarn:

```bash
yarn add react-showhide-component
```

## Usage

```jsx
import React, { Component } from 'react'

import ReactShowHideComponent from 'react-showhide-component'

const arr = [1, 2, 3, 4, 5];

export default class Example extends Component {
  render() {
    const listHtml = arr.map((elem, i) => {
      return <div key={i}>{elem}</div>;
    });
    return <ReactShowHideComponent items={listHtml} minItems={2} />;
  }
}
```

## Props

| Property      | Type               | Default                               | Description                                                                                                                                  |
|:--------------|:-------------------|:--------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------|
| `items`  | string \| array           | undefined                                  | Array of elements of string |
| `minItems`     | number           | undefined                                  | No of element(for array) / lines (for string) to show by default |
| `mode`   | string           | array                                 | 'array' or 'string'  |
| `viewMoreButton`         | element           | <div>View More</div>                                  | View more button |
| `viewLessButton`           | element              | <div>View Less</div>                            | View less button |

## License

MIT © [https://github.com/vaibhavdiwani](https://github.com/vaibhavdiwani)


**Any help in improvement/optimization is very much appreciated**

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