New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tw-react-if

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tw-react-if

A simple React conditional rendering component with display, Tailwind, and remove modes.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

tw-react-if

A simple and lightweight React component for conditional rendering.
Supports three modes: CSS display, Tailwind hidden, and full removal from the DOM.

Installation

bun add tw-react-if

or with npm:

npm install tw-react-if

Usage

import { IF } from "tw-react-if";

function App() {
  return (
    <div>
      <IF condition={true} mode="display">
        <p>Visible using CSS display</p>
      </IF>

      <IF condition={false} mode="tailwind">
        <p>Hidden using Tailwind</p>
      </IF>

      <IF condition={false} mode="remove">
        <p>This will not be rendered at all</p>
      </IF>
    </div>
  );
}

Props

NameTypeDefaultDescription
conditionbooleanrequiredThe condition to render or hide children.
mode"display", "tailwind", "remove""display"Defines the hiding method.
displaystring"block"The display style when visible.

License

MIT © Mohamed Abdelrahman

Follow @mo7amed4a on GitHub

Keywords

react

FAQs

Package last updated on 21 Oct 2025

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