Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/harshmakadia/use-lorem-ipsum

custom use hook
https://github.com/harshmakadia/use-lorem-ipsum

custom-hooks hooks reactjs

Last synced: 1 day ago
JSON representation

custom use hook

Awesome Lists containing this project

README

        

# use-lorem-ipsum

> React Hook for generating random lorem ipsum words, sentences, paragraphs

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

## Install

```bash
npm add use-lorem-ipsum
```

## Signature

```jsx
const message = useLoremIpsum(type, count);
```

## Props

Name | Type | Required | Default value | Description
:--- | :--- | :--- | :--- | :---
`type` | `string` | yes | - | specify one from `words`, `sentences`, `paragraphs`
`count` | `number` | _optional_ | 1 | specify number of times the `type` should be repeated

## Example
[Codesandbox Demo 📦](https://codesandbox.io/s/use-lorem-ipsum-forked-6gf24?file=/src/App.js)

## Usage

```jsx
import React from 'react'

import { useLoremIpsum } from 'use-lorem-ipsum'

export default () => {
const message = useLoremIpsum("words", 2);

return (


Hello {message}

);
}
```

## Demo
![Demo](https://user-images.githubusercontent.com/13532530/93763878-d2e35e00-fc2f-11ea-925b-926c79abb735.png)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Harsh Makadia

💻 🎨 🤔

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## License

© [HarshMakadia](https://github.com/Harshmakadia)