Feature Flags

Expose features to your users using feature flags.

Props#

Has#

PropTypeDefaultDescription
featurerequiredstring | string[]One or more flags to match.
childrenstring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | (({ flags }: { ... }) => ReactElement<...>)Children will be rendered when the result is valid.
exactbooleantrueMatch all or some flags.
fallbacktype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNodeRenders the result is invalid.
notbooleanInverse matching, eg will be valid when no flags match.
valueanyMatch the supplied flags to this value. Matches all truthy values by default.

FeaturesProvider#

PropTypeDefaultDescription
childrentype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode
valueFeaturesOptions

Types#

FeaturesOptions#

PropTypeDefaultDescription
segmentsrequiredSegment[]
attrUserAttributes

Was this helpful?