Concepts
OverviewCompositionTestingLayout
Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrapComponents
AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltipUtilities
Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFrameHighlightJSON Tree ViewLocaleLocal StoragePortalPresenceShowsplitPropsThemeimport { FeatureFlags, FeatureFlag } from '@cerberus/react''use client'
import { FeatureFlags, FeatureFlag } from '@cerberus/react'import { useMemo } from 'react'
function FeatureFlagsPreview() { const flags = useMemo( () => ({ featureOne: true, featureTwo: false, }), [], )
return ( <FeatureFlags flags={flags}> <FeatureFlag flag="featureOne">This is a visible feature</FeatureFlag> <FeatureFlag flag="featureTwo">This is a hidden feature</FeatureFlag> </FeatureFlags> )}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.ElementThe FeatureFlag component accepts the following props:
| Name | Default | Description |
|---|---|---|
| flag | null | A unique key of the flags data passed into the provider. |
On this page