@austral-ui/render-if
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

RenderIf

npm GitHub issues NPM

RenderIf is a function that receives a validation as a parameter, and if that validation is true, the content passed as children will be displayed. Try it!

Installation

npm install @austral-ui/render-if

Usage

See it in Action

import React from 'react';
import { RenderIf } from '@austral-ui/render-if';

export function App() {

  const widthSize = window.innerWidth;

  return (
    <div>
        <RenderIf isTrue={widthSize > 600}>
          <span>You are using a large screen</span>
        </RenderIf>
    </div>
  );
}

export default App;

Support

If you have read the examples and have any issues which you know are glitches, or would like to request something changed, please feel free to post an issue on Github.

Otherwise, if this was useful and you'd like to show your support, no donations necessary, but please consider checking out the repo and giving it a star ().

License

Package Sidebar

Install

npm i @austral-ui/render-if

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.12 kB

Total Files

6

Last publish

Collaborators

  • oscarcornejo