Experiment Screens
Admin screens for A/B experiments: a list, a per-variant results readout, a create and edit form, and a pricing readout.
onboarding-checklist
RunningChecklist on the first screen
Goal: activated
| Variant | Weight | Exposed | Converted | Rate | Lift | p-value | |
|---|---|---|---|---|---|---|---|
| controlControl | 50 | 1840 | 312 | 17.0% | – | – | |
| checklist | 50 | 1822 | 391 | 21.5% | +26.5% | <0.001Significant |
import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiments, results } from "./experiments"
function ExperimentResultsDemo() {
return (
<ExperimentResults
className="w-full max-w-3xl"
experiment={experiments[0]}
results={results}
onStop={() => undefined}
onRollout={() => undefined}
/>
)
}Installation
npm i @dapplelight/signet-uiUsage
import {
ExperimentList,
ExperimentResults,
ExperimentForm,
PricingExperimentResults,
} from "@dapplelight/signet-ui/screens/experiment-screens"Data is shaped like signet-db's createExperiments results or the experimentAdminRoutes JSON; actions come out as callbacks that may be async. An action that throws or resolves false shows the failure message.
import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiment, results, stop } from "./experiments"
<ExperimentResults experiment={experiment} results={results} onStop={stop} />Examples
ExperimentList
Experiments
import { useState } from "react"
import { ExperimentList } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiments } from "./experiments"
function ExperimentListDemo() {
const [selected, setSelected] = useState("onboarding-checklist")
return (
<ExperimentList
className="w-full max-w-xl"
experiments={experiments}
selected={selected}
onSelect={setSelected}
/>
)
}ExperimentResults
onboarding-checklist
RunningChecklist on the first screen
Goal: activated
| Variant | Weight | Exposed | Converted | Rate | Lift | p-value | |
|---|---|---|---|---|---|---|---|
| controlControl | 50 | 1840 | 312 | 17.0% | – | – | |
| checklist | 50 | 1822 | 391 | 21.5% | +26.5% | <0.001Significant |
import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiments, results } from "./experiments"
function ExperimentResultsDemo() {
return (
<ExperimentResults
className="w-full max-w-3xl"
experiment={experiments[0]}
results={results}
onStop={() => undefined}
onRollout={() => undefined}
/>
)
}ExperimentForm
import { ExperimentForm } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiments } from "./experiments"
function ExperimentFormDemo() {
return (
<ExperimentForm
className="w-full max-w-xl"
experiment={experiments[1]}
onSubmit={() => true}
onStart={() => undefined}
/>
)
}PricingExperimentResults
annual-first-paywall
RunningRunning on onboarding
| Variant | Offering | Exposed | Conversion | Lift | p-value | Trial conversion | Revenue / exposed user | LTV (estimate) | |
|---|---|---|---|---|---|---|---|---|---|
| monthly-firstControl | pro-monthly | 2400 | 7.0% | – | – | 29.0% | $0.70 | ~$54 | |
| annual-first | pro-annual | 2380 | 9.0% | +28.6% | 0.011Significant | 35.0% | $1.08 | ~$62 |
import { PricingExperimentResults, type PricingReadoutView } from "@dapplelight/signet-ui/screens/experiment-screens"
import { experiments } from "./experiments"
function PricingExperimentResultsDemo() {
const readout: PricingReadoutView = {
placements: ["onboarding"],
alpha: 0.05,
control: "monthly-first",
variants: [
{
key: "monthly-first",
offering: { offering: "pro-monthly" },
exposed: 2400,
converted: 168,
rate: 0.07,
lift: null,
pValue: null,
significant: false,
trials: 410,
trialConverted: 120,
trialConversion: 0.29,
revenue: { USD: 167832 },
revenuePerExposed: { USD: 70 },
ltv: { estimate: true, perCurrency: { USD: 5400 }, churn: 0.08, expectedPayments: 12 },
},
{
key: "annual-first",
offering: { offering: "pro-annual" },
exposed: 2380,
converted: 214,
rate: 0.09,
lift: 0.2857,
pValue: 0.011,
significant: true,
trials: 430,
trialConverted: 150,
trialConversion: 0.35,
revenue: { USD: 256800 },
revenuePerExposed: { USD: 108 },
ltv: { estimate: true, perCurrency: { USD: 6200 }, churn: 0.06, expectedPayments: 16 },
},
],
}
return (
<PricingExperimentResults
className="w-full max-w-4xl"
experiment={{ ...experiments[1], status: "running" }}
readout={readout}
onRollout={() => undefined}
onStop={() => undefined}
/>
)
}API Reference
All screens also accept the props of their root element and labels (Partial<ExperimentLabels>, defaults in DEFAULT_EXPERIMENT_LABELS).
ExperimentList
| Prop | Type | Default | Description |
|---|---|---|---|
experiments | readonly ExperimentView[] | required | Experiments to list. |
selected | string | - | Key of the experiment shown, marked aria-current. |
onSelect | (key: string) => void | - | Called when one is picked. |
ExperimentResults
| Prop | Type | Default | Description |
|---|---|---|---|
experiment | ExperimentView | required | The experiment. |
results | ExperimentResultsView | null | - | Per-variant results; null when the server has no events table. |
onStart | () => unknown | - | Start or resume. |
onStop | () => unknown | - | Stop. |
onRollout | (variant: string) => unknown | - | Roll out a variant. |
ExperimentForm
| Prop | Type | Default | Description |
|---|---|---|---|
experiment | ExperimentView | - | The experiment to edit; omitted creates one. |
offerings | readonly OfferingChoice[] | - | Offerings to pick per variant (pricing experiment); omitted shows a JSON value field. |
onSubmit | (input: ExperimentInputView) => unknown | required | Create or save. Resolve false or throw to show the failure. |
onStart | () => unknown | - | Start the experiment. |
onStop | () => unknown | - | Stop the experiment. |
PricingExperimentResults
| Prop | Type | Default | Description |
|---|---|---|---|
experiment | ExperimentView | required | The experiment. |
readout | PricingReadoutView | required | Per-variant offering, conversion, trial conversion, revenue and LTV. |
onRollout | (variant: string) => unknown | - | Make a variant's offering the placement's offering. |
onStart | () => unknown | - | Start the experiment. |
onStop | () => unknown | - | Stop the experiment. |
ExperimentStatusBadge
| Prop | Type | Default | Description |
|---|---|---|---|
status | "draft" | "running" | "stopped" | "rolled_out" | required | Status to show. |
labels | Partial<ExperimentLabels> | - | Override any string. |
Cost Dashboard
AI cost for the admin: spend over time with what the cache saved, spend by model, the top spenders (subject hashes, as the server gives them), and how much of the global day and month caps is used. Data is what signet-server's `observabilityAdminRoutes` returns (`series`, `models`, `top`) plus the global caps from signet-db's `usage("global")`; hand it in as `data`, or give a `fetcher(days)` and the screen loads and retries itself. Money is millionths of a USD. recharts is an optional peer, so this screen has its own export path, `@dapplelight/signet-ui/screens/cost-dashboard`, never the barrel.
Funnel Screens
Web-to-app funnel screens: questions, a paywall with the URL discount priced in, Stripe checkout and the post-purchase redemption card.