@molecule/app-feature-flag-row-solid
Feature · feature-flag-row · App (browser) · v1.1.2 · Apache-2.0
Feature-flag list row: name + status + rollout% + environment toggles
npm install @molecule/app-feature-flag-row-solidHow it works
@molecule/app-feature-flag-row-solid is a ready-made feature-flag-row feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
import { FeatureFlagRow } from '@molecule/app-feature-flag-row-solid'
export function FlagsList() {
return (
<FeatureFlagRow
flag={{
key: 'new-checkout',
name: 'New Checkout Flow',
description: 'Redesigned multi-step checkout experience.',
type: 'percentage',
environments: [
{ id: 'staging', label: 'Staging', enabled: true, rolloutPct: 100 },
{ id: 'production', label: 'Production', enabled: true, rolloutPct: 20 },
],
}}
onToggle={(key, envId, next) => updateFlag(key, envId, next)}
/>
)
}Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid
Reference
Solid feature-flag list row — flag name + type badge + key + description on
the left, one labelled <Switch> per environment (with a rollout-%
readout for percentage flags) on the right. Stack rows inside a list or
table to build a flags dashboard.
Exports FeatureFlagRow and the FeatureFlag, FeatureFlagEnvironment,
and FlagType types. It is the Solid counterpart of
@molecule/app-feature-flag-row-react: the same props (React names) and the
same DOM for the same input.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import { FeatureFlagRow } from '@molecule/app-feature-flag-row-solid'
export function FlagsList() {
return (
<FeatureFlagRow
flag={{
key: 'new-checkout',
name: 'New Checkout Flow',
description: 'Redesigned multi-step checkout experience.',
type: 'percentage',
environments: [
{ id: 'staging', label: 'Staging', enabled: true, rolloutPct: 100 },
{ id: 'production', label: 'Production', enabled: true, rolloutPct: 20 },
],
}}
onToggle={(key, envId, next) => updateFlag(key, envId, next)}
/>
)
}
Type
feature
Installation
npm install @molecule/app-feature-flag-row-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
API
Interfaces
FeatureFlagEnvironment
Per-environment state for a feature flag, including enabled status and optional rollout percentage.
interface FeatureFlagEnvironment {
/** Environment id (e.g. "production", "staging"). */
id: string
/** Display label. */
label: JSX.Element
/** Enabled in this env. */
enabled: boolean
/** Rollout percentage 0-100. Optional — render when `type='percentage'`. */
rolloutPct?: number
}
FeatureFlag
Complete definition of a feature flag including its key, display name, type, and per-environment configuration.
interface FeatureFlag {
/** Stable machine key (also the switch's `aria-label` prefix). */
key: string
/** Display name. */
name: JSX.Element
/** Optional tagline. */
description?: JSX.Element
/** The kind of flag. */
type: FlagType
/** One entry per environment. */
environments: FeatureFlagEnvironment[]
}
FeatureFlagRowProps
Props accepted by FeatureFlagRow.
interface FeatureFlagRowProps {
/** The flag to render. */
flag: FeatureFlag
/** Called when an environment toggles. */
onToggle: (flagKey: string, envId: string, next: boolean) => void
/** Extra classes. */
className?: string
}
Types
FlagType
Discriminant for the kind of feature flag (boolean, multivariate, percentage rollout, or string variant).
type FlagType = 'boolean' | 'multivariate' | 'percentage' | 'string'
Functions
FeatureFlagRow(props)
Feature-flag list row with per-environment toggle + rollout-percentage display. Use inside a grid or table to build a flags dashboard.
function FeatureFlagRow(props: FeatureFlagRowProps): JSX.Element
props— Component props (seeFeatureFlagRowProps).
Returns: The rendered feature-flag row.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-solid^3.5.0 || ^4.0.0@molecule/app-ui^1.0.1@molecule/app-ui-solid^1.1.0solid-js^1.8.0
Runtime Dependencies
@molecule/app-solid@molecule/app-ui@molecule/app-ui-solidsolid-js
The environment toggle is the <Switch> from the
@molecule/app-ui-solid peer dependency — that package must be installed
and its ClassMap bond wired for the row to render styled.
rolloutPct is displayed only when flag.type === 'percentage'; on other
flag types the field is ignored. The row is presentation-only: onToggle
receives (flagKey, envId, next) and the caller persists the change and
re-renders with updated flag data.
The type badge translates via one literal t('flagType.<type>') call per
flag type (a runtime-built key would be invisible to molecule's i18n gate),
with a capitalized English label (Boolean, Multivariate, Percentage,
String) as the fallback. The environment toggle's aria-label translates
via featureFlagRow.aria.flagInEnvironment. All keys ship in the
@molecule/app-locales-feature-flag-row companion bond (79 languages).
Translations
Translation strings are provided by @molecule/app-locales-feature-flag-row.