Feature Flags

Feature Flags display or hide content in the UI.

1
import { FeatureFlags, FeatureFlag } from '@cerberus-design/react'

When to use

When you need render a component based on if it should be enabled or not.

Usage

preview modeThis is a visible feature

API

export interface FeatureFlagsProviderValue {
flags: Record<string, boolean>
}
export interface FeatureFlagProps {
// A unique key of the flags data passed into the provider.
flag: string
}
define function FeatureFlag(props: PropsWithChildren<FeatureFlagProps>): JSX.Element

Props

The FeatureFlag component accepts the following props:

NameDefaultDescription
flagnullA unique key of the flags data passed into the provider.

On this page