React Lever screenshot

React Lever

Author Avatar Theme by Medipass
Updated: 16 May 2019
75 Stars

A library to conditionally render React components based on feature toggles.

Overview

React Lever is a powerful library designed for managing and conditionally rendering React components based on feature toggles. This tool allows developers to easily switch features on or off based on specific conditions, ultimately streamlining the development process and enhancing user experiences. By wrapping your application in a <LeverProvider> and using the <Lever> component, you can have granular control over which features to display, making it an excellent choice for applications with multiple development phases or varying user access levels.

Whether you’re working in a development environment or preparing for production, React Lever provides the flexibility to tailor your application’s features seamlessly. Its straightforward API facilitates smooth integration, allowing developers to focus on building high-quality applications without cluttering the codebase with extensive conditional logic.

Features

  • Easy Integration: Simply wrap your application with <LeverProvider> and conditionally render components using <Lever>.
  • Development Toggle Support: The isDev prop allows for features to be tested in a development environment without affecting the production build.
  • Feature Flags Management: Each feature can be controlled with flags like enabled and devOnly, providing fine-tuned control over what users see.
  • Dynamic Rendering: The either prop allows for flexibility by rendering children if any of the features provided are enabled.
  • Custom Options: Use the useLever hook to access features with flexible options like disabled or forceEnabled for advanced requirements.
  • MIT License: React Lever is freely available under the MIT license, ensuring wide accessibility for developers.
  • Support for Arrays: Easily manage multiple features using an array format for the feature prop, making it versatile for complex applications.