Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/harshmakadia/use-lorem-ipsum
- Owner: Harshmakadia
- License: mit
- Created: 2020-09-21T06:51:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T04:20:27.000Z (over 4 years ago)
- Last Synced: 2024-12-27T08:18:09.915Z (19 days ago)
- Topics: custom-hooks, hooks, reactjs
- Language: JavaScript
- Homepage:
- Size: 107 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)):
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)