Puck and field exports
Exports for Puck render and editor configs, Payload fields and blocks, and the admin stylesheets.
/puck
For Puck render configs. Import from @delmaredigital/payload-experiments/puck.
| Export | Purpose |
|---|---|
experimentsPuck({ routes? }) | One integration object for payload-puck's extendConfig({ integrations }): the Experiment block and its A/B tests category |
ExperimentSlot, createExperimentSlot({ routes }) | The render component, with default or custom routes |
EXPERIMENT_SLOT_TYPE | 'ExperimentSlot', the component key |
createExperimentSlotField({ label?, routes? }) | The test picker as a Puck custom field, for other components |
xpGoalPuckField() | The click-goal prop for render configs (a text field) |
ExperimentsPuckIntegration, PuckRoutes, ArmSlot, ExperimentRef, ExperimentSlotProps | Types |
/puck/editor
For Puck editor configs, in a 'use client' module. Import from @delmaredigital/payload-experiments/puck/editor.
| Export | Purpose |
|---|---|
experimentsPuckEditor({ routes?, accent? }) | One integration object for PuckConfigProvider's integrations: the editor block, its category and the outline plugin. Create it once at module scope |
ExperimentSlotEditor, createExperimentSlotEditor({ routes, accent }) | The editor component |
experimentOutlinePlugin() | Hides empty version slots the test doesn't use from Puck's outline |
xpGoalPuckEditorField({ routes? }) | The click-goal picker with inline creation |
deriveAccent | The accent derivation used by the admin theme |
PuckRoutes is { admin?: string; api?: string }, defaulting to /admin and /api.
Package root fields and blocks
From @delmaredigital/payload-experiments:
| Export | Purpose |
|---|---|
createExperimentBlock({ blocks, slug? }) | The Experiment block for a Payload blocks field. Default slug xpExperiment |
EXPERIMENT_BLOCK_SLUG | 'xpExperiment' |
xpGoalField() | A text field named xpGoal with the click-goal picker |
createArmSelectField({ flagPoint, name?, label?, required? }) | Tag host content with a test group. Default name experimentArm |
defineFlagPoint, defineMetricSource | Typed identity helpers |
contentDone(report) | true when every entry in a make-content report is updated or dismissed |
/blocks
From @delmaredigital/payload-experiments/blocks: controlOnlyBlocks(blocks, blockSlug?), segmentExperimentBlocks(blocks), EXPERIMENT_BLOCK_SLUG and the block types.
Stylesheets
| Export | Use |
|---|---|
@delmaredigital/payload-experiments/puck/editor.css | Inside the Puck editor iframe |
@delmaredigital/payload-experiments/admin/theme.css | Puck outside the Payload admin |
@delmaredigital/payload-experiments/admin/ui.css | Puck outside the Payload admin |

