Skip to content

Placeholder component to wrap the content(other components) that you don't know if it will show anything

License

Notifications You must be signed in to change notification settings

Donaldcwl/react-empty-placeholder

Repository files navigation

react-empty-placeholder

Placeholder component to wrap the content(other components) that you don't know if it will show anything

NPM NPM Travis Codecov JavaScript Style Guide

Install

yarn add react-empty-placeholder
# or
npm install --save react-empty-placeholder

Usage

import React, { Component } from 'react'

import EmptyPlaceholder from 'react-empty-placeholder'

class Example extends Component {
  render () {
    return (
      <EmptyPlaceholder placeholder={<div>placeholder if nothing display inside</div>}>
        {this.props.boolean && <div>show when boolean is truthy</div>}

        <SomeComponentYouDontKnowIfItWillShowAnything />
      </EmptyPlaceholder>
    )
  }
}

License

MIT © Donald

About

Placeholder component to wrap the content(other components) that you don't know if it will show anything

Resources

License

Stars

Watchers

Forks

Packages

No packages published