Creators to follow

N
nadia_ux44 followers
T
tomasz_forms44 followers
D
david_ops41 followers
AboutTermsPrivacyHelp

© 2026 teliprompt

AL
alex_ui
8 months ago•
UI / UX

A/B test wrapper component with analytics hooks

Claude Opus 4.6
code output
#ab-testing
#experimentation
#react
#analytics
Views
9.3K
Copies
2.4K
Likes
1.0K
Comments
0
Copy rate
26.0%

Prompt

Build a React component wrapper for A/B experiments that integrates with [analytics_provider]. It should:

- Accept an experimentKey and variants (A, B, optionally C)
- Read the assigned variant from [variant_source] (feature flag provider, localStorage, or server)
- Fire an exposure event the first time a user actually sees the variant (via IntersectionObserver)
- Never flicker — SSR-safe, renders a stable variant on first paint
- Provide a useVariant hook for imperative use
- Deduplicate exposure events per session
- Be fully typed

Output a single file plus a usage example.

Customise this prompt

Fill in 2 variables to personalise this prompt

Preview
Build a React component wrapper for A/B experiments that integrates with [analytics_provider]. It should: - Accept an experimentKey and variants (A, B, optionally C) - Read the assigned variant from [variant_source] (feature flag provider, localStorage, or server) - Fire an exposure event the first time a user actually sees the variant (via IntersectionObserver) - Never flicker — SSR-safe, renders a stable variant on first paint - Provide a useVariant hook for imperative use - Deduplicate exposure events per session - Be fully typed Output a single file plus a usage example.

Example output

Related prompts

Responsive stats dashboard grid from screenshot descriptionby @priya_design
UI / UX
Responsive pricing card component with toggle animationby @felix_pixels
UI / UX
Competitive UX teardown comparing two products side by sideby @alex_ui
UI / UX
Keyboard-only accessibility test script with checklistby @nadia_ux
UI / UX