Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-lorem-component

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lorem-component

A component for React that renders paragraph or list item tags full of lorem ipsum placeholder text

  • 0.13.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
increased by14.08%
Maintainers
1
Weekly downloads
 
Created
Source

React Lorem Component

A component for React that renders paragraph or list item tags full of lorem ipsum placeholder text.

Installation

Install via npm:

% npm install react-lorem-component

Usage

This library provides a React component named Lorem which renderes pseudo-random lorem ipsum text.

var React = require('react');
var Lorem = require('react-lorem-component');

var MyComponent = React.createClass({
  render: function() {
    return (
      <div>
        <h1>Lorem Ipsum</h1>
        <Lorem />
      </div>
    );
  }
});

The above <Lorem /> tag by default renders five paragraphs of lorem wrapped in a <div>.

Configuration Options

You can pass the following props to the Lorem component to fine-tune the output.

PropDefaultDescription
mode'paragraphs'if set to 'list', instead of <p> tags wrapped in a <div> it renders <li>s wrapped in an <ul>
orderedfalseif mode is set to 'list' and this prop has a truthy value, the list items are wrapped in an <ol> tag
seed0the seed of the random number generator used for generating lorem text; changing this to a different natural number generates a different text
count5number of paragraphs to generate
sentenceLowerBound5minimum words per sentence
sentenceUpperBound15maximum words per sentence
paragraphLowerBound3minimum sentences per paragraph
paragraphUpperBound7maximum sentences per paragraph
format'html'plain text or html
words['ad','dolor',...]custom word dictionary

The last seven properties are send directly to the lorem-ipsum node module which is used internally to generate the lorem text.

Other properties you pass (eg. className) are transferred to the wrapping tag.

Example

The examples code is located at example directory. You can clone this repository and run make install example and point your web browser to http://localhost:3000.

Licence

Released under The MIT License.

Keywords

FAQs

Package last updated on 14 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc