export function subscriptionBoxFinderQuiz(form: FormTs) {
form.setTitle(() => '📦 Find Your Perfect Subscription Box');
// ============ RECOMMENDATION SYSTEM ============
const answers = form.state<Record<string, string | string[] | number>>({});
const setAnswer = (key: string, value: string | string[] | number) => {
answers.update(current => ({ ...current, [key]: value }));
};
type Category = 'beauty' | 'food' | 'lifestyle' | 'fitness' | 'books' | 'pets' | 'kids' | 'hobbies';
const getBoxRecommendations = (): { name: string; category: string; price: string; description: string; bestFor: string }[] => {
const category = answers()['category'] as Category;
const budget = answers()['budget'] as string;
const frequency = answers()['frequency'] as string;
const preferences = (answers()['preferences'] as string[]) || [];
const allBoxes: Record<Category, { name: string; price: string; description: string; bestFor: string; tier: string }[]> = {
beauty: [
{ name: 'Ipsy Glam Bag', price: '$14/month', description: '5 personalized beauty products', bestFor: 'Discovery & trying new products', tier: 'budget' },
{ name: 'Birchbox', price: '$15/month', description: '5 curated samples + full-size options', bestFor: 'Premium sample discovery', tier: 'budget' },
{ name: 'BoxyCharm', price: '$28/month', description: '5 full-size products worth $175+', bestFor: 'Full-size product lovers', tier: 'mid' },
{ name: 'Allure Beauty Box', price: '$25/month', description: 'Editor-curated beauty picks', bestFor: 'Trend-conscious beauty lovers', tier: 'mid' },
{ name: 'FabFitFun', price: '$55/quarter', description: '8+ full-size lifestyle products', bestFor: 'Variety seekers', tier: 'premium' },
{ name: 'Glossybox', price: '$21/month', description: '5 luxury beauty products', bestFor: 'Luxury beauty fans', tier: 'mid' }
],
food: [
{ name: 'SnackCrate', price: '$14-46/month', description: 'Snacks from around the world', bestFor: 'International snack explorers', tier: 'budget' },
{ name: 'HelloFresh', price: '$9-12/serving', description: 'Fresh meal kits delivered weekly', bestFor: 'Busy home cooks', tier: 'mid' },
{ name: 'Blue Apron', price: '$8-10/serving', description: 'Premium meal kits with recipes', bestFor: 'Aspiring chefs', tier: 'mid' },
{ name: 'Butcher Box', price: '$137-270/month', description: 'Grass-fed meat & seafood', bestFor: 'Quality meat lovers', tier: 'premium' },
{ name: 'Universal Yums', price: '$16-42/month', description: 'Snacks from different countries', bestFor: 'Adventure snackers', tier: 'budget' },
{ name: 'Misfit Market', price: '$22-35/box', description: 'Organic produce, discounted', bestFor: 'Budget organic shoppers', tier: 'budget' }
],
lifestyle: [
{ name: 'FabFitFun', price: '$55/quarter', description: 'Beauty, fashion, fitness & home', bestFor: 'Variety lovers', tier: 'premium' },
{ name: 'Causebox', price: '$55/quarter', description: 'Socially conscious products', bestFor: 'Eco-conscious consumers', tier: 'premium' },
{ name: 'TheraBox', price: '$35/month', description: 'Self-care & wellness products', bestFor: 'Self-care enthusiasts', tier: 'mid' },
{ name: 'Bespoke Post', price: '$50/month', description: 'Curated lifestyle goods for men', bestFor: 'Style-conscious men', tier: 'premium' },
{ name: 'Gentleman\'s Box', price: '$29/month', description: 'Men\'s accessories & lifestyle', bestFor: 'Professional men', tier: 'mid' },
{ name: 'SinglesSwag', price: '$40/month', description: 'Fun items for single women', bestFor: 'Single ladies celebrating life', tier: 'mid' }
],
fitness: [
{ name: 'Gainz Box', price: '$33/month', description: 'Fitness supplements & gear', bestFor: 'Gym enthusiasts', tier: 'mid' },
{ name: 'Barbella Box', price: '$50/month', description: 'Women\'s fitness apparel & gear', bestFor: 'Active women', tier: 'premium' },
{ name: 'STRONGBOX', price: '$45/month', description: 'Fitness gear & supplements', bestFor: 'Serious athletes', tier: 'mid' },
{ name: 'RunnerBox', price: '$23/month', description: 'Running gear & nutrition', bestFor: 'Runners', tier: 'budget' },
{ name: 'Yoga Club', price: '$79/month', description: 'Full yoga outfit monthly', bestFor: 'Yoga practitioners', tier: 'premium' },
{ name: 'Love Goodly', price: '$30/bi-monthly', description: 'Vegan wellness products', bestFor: 'Vegan fitness fans', tier: 'mid' }
],
books: [
{ name: 'Book of the Month', price: '$17/month', description: 'Choose from 5 new releases', bestFor: 'Fiction lovers', tier: 'budget' },
{ name: 'OwlCrate', price: '$32/month', description: 'YA book + bookish goodies', bestFor: 'Young adult readers', tier: 'mid' },
{ name: 'Once Upon a Book Club', price: '$35/month', description: 'Book + wrapped gifts to open', bestFor: 'Immersive readers', tier: 'mid' },
{ name: 'The Bookish Box', price: '$35/month', description: 'Romance books + merchandise', bestFor: 'Romance readers', tier: 'mid' },
{ name: 'Literati', price: '$10/month (kids)', description: 'Curated children\'s books', bestFor: 'Parents of young readers', tier: 'budget' },
{ name: 'Uppercase Box', price: '$29/month', description: 'YA books with exclusive extras', bestFor: 'Teen readers', tier: 'mid' }
],
pets: [
{ name: 'BarkBox', price: '$29/month', description: '2 toys, 2 treats, 1 chew for dogs', bestFor: 'Dog owners', tier: 'mid' },
{ name: 'Super Chewer', price: '$34/month', description: 'Tough toys for power chewers', bestFor: 'Aggressive chewer owners', tier: 'mid' },
{ name: 'Meowbox', price: '$23/month', description: 'Cat toys and treats', bestFor: 'Cat parents', tier: 'budget' },
{ name: 'PupBox', price: '$39/month', description: 'Training-focused puppy items', bestFor: 'Puppy owners', tier: 'mid' },
{ name: 'KitNipBox', price: '$20/month', description: 'Multi-cat household friendly', bestFor: 'Multi-cat households', tier: 'budget' },
{ name: 'Pet Treater', price: '$15/month', description: 'Budget-friendly pet treats', bestFor: 'Budget pet parents', tier: 'budget' }
],
kids: [
{ name: 'KiwiCo', price: '$20-25/month', description: 'STEM & craft projects by age', bestFor: 'Curious kids 0-16+', tier: 'budget' },
{ name: 'Little Passports', price: '$20-27/month', description: 'World exploration & science', bestFor: 'Adventurous learners', tier: 'budget' },
{ name: 'Lovevery', price: '$80/bi-monthly', description: 'Montessori play kits by age', bestFor: 'Parents of babies/toddlers', tier: 'premium' },
{ name: 'Raddish Kids', price: '$24/month', description: 'Cooking kits for kids', bestFor: 'Little chefs', tier: 'mid' },
{ name: 'MEL Science', price: '$35/month', description: 'Science experiments at home', bestFor: 'Science enthusiasts', tier: 'mid' },
{ name: 'Highlights Hello', price: '$18/month', description: 'Learning fun for little ones', bestFor: 'Preschoolers', tier: 'budget' }
],
hobbies: [
{ name: 'Hunt A Killer', price: '$30/month', description: 'Murder mystery game episodes', bestFor: 'Mystery lovers', tier: 'mid' },
{ name: 'Cratejoy Craft', price: '$30-50/month', description: 'Various craft subscriptions', bestFor: 'Crafty people', tier: 'mid' },
{ name: 'Loot Crate', price: '$30/month', description: 'Geek & gaming merchandise', bestFor: 'Geeks & gamers', tier: 'mid' },
{ name: 'ArtSnacks', price: '$30/month', description: 'Premium art supplies', bestFor: 'Artists', tier: 'mid' },
{ name: 'Vinyl Me Please', price: '$43/month', description: 'Exclusive vinyl records', bestFor: 'Music collectors', tier: 'premium' },
{ name: 'Brick Loot', price: '$27/month', description: 'LEGO-compatible building sets', bestFor: 'LEGO enthusiasts', tier: 'mid' }
]
};
const categoryBoxes = allBoxes[category] || allBoxes['lifestyle'];
// Filter by budget
let filtered = categoryBoxes;
if (budget === 'under-20') {
filtered = categoryBoxes.filter(b => b.tier === 'budget');
} else if (budget === '20-40') {
filtered = categoryBoxes.filter(b => b.tier === 'budget' || b.tier === 'mid');
} else if (budget === '40-60') {
filtered = categoryBoxes.filter(b => b.tier === 'mid' || b.tier === 'premium');
}
if (filtered.length === 0) filtered = categoryBoxes;
return filtered.slice(0, 3).map(({ name, price, description, bestFor }) => ({
name,
category,
price,
description,
bestFor
}));
};
const getTopRecommendation = () => {
const recs = getBoxRecommendations();
return recs[0] || { name: 'FabFitFun', price: '$55/quarter', description: 'Lifestyle variety box', bestFor: 'Everyone' };
};
// ============ COMPLETION SCREEN ============
form.configureCompletionScreen({
type: 'text',
title: () => '📦 Your Perfect Subscription Boxes',
message: () => {
const top = getTopRecommendation();
return `We recommend ${top.name}! Download your complete guide with comparison charts and exclusive discount codes.`;
}
});
// ============ PAGES SETUP ============
const pages = form.addPages('quiz-pages', {
heightMode: 'current-page'
});
// ============ PAGE 1: Category ============
const page1 = pages.addPage('category', { mobileBreakpoint: 500 });
page1.addRow(row => {
row.addTextPanel('header1', {
label: 'Step 1 of 5: What Are You Into?',
computedValue: () => 'Let\'s find the perfect subscription category for you',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page1.addSpacer({ height: '24px' });
page1.addRow(row => {
row.addRadioButton('category', {
label: 'What type of subscription interests you most?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'beauty', name: '💄 Beauty & Skincare - Makeup, skincare, hair products' },
{ id: 'food', name: '🍽️ Food & Snacks - Meal kits, snacks, gourmet items' },
{ id: 'lifestyle', name: '🏠 Lifestyle - Home, wellness, variety boxes' },
{ id: 'fitness', name: '💪 Fitness & Health - Supplements, gear, apparel' },
{ id: 'books', name: '📚 Books & Reading - Fiction, non-fiction, book clubs' },
{ id: 'pets', name: '🐾 Pets - Toys, treats, supplies' },
{ id: 'kids', name: '👶 Kids & Family - STEM, crafts, learning' },
{ id: 'hobbies', name: '🎮 Hobbies & Interests - Gaming, crafts, collectibles' }
],
onValueChange: (val) => setAnswer('category', val || '')
});
});
// ============ PAGE 2: Preferences ============
const page2 = pages.addPage('preferences', { mobileBreakpoint: 500 });
page2.addRow(row => {
row.addTextPanel('header2', {
label: 'Step 2 of 5: Your Preferences',
computedValue: () => 'Help us narrow down the perfect box',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addSuggestionChips('preferences', {
label: 'What\'s important to you in a subscription?',
suggestions: [
{ id: 'discovery', name: '🔍 Discover new things' },
{ id: 'value', name: '💰 Great value' },
{ id: 'eco', name: '🌱 Eco-friendly' },
{ id: 'customization', name: '🎯 Personalization' },
{ id: 'full-size', name: '📦 Full-size products' },
{ id: 'variety', name: '🎨 Variety' }
],
alignment: 'left',
max: 3,
onValueChange: (val) => setAnswer('preferences', val || [])
});
});
page2.addRow(row => {
row.addRadioButton('purpose', {
label: 'Is this box for yourself or a gift?',
isRequired: true,
orientation: 'horizontal',
options: [
{ id: 'self', name: 'For myself' },
{ id: 'gift', name: 'As a gift' },
{ id: 'both', name: 'Both' }
],
onValueChange: (val) => setAnswer('purpose', val || '')
});
});
// ============ PAGE 3: Budget & Frequency ============
const page3 = pages.addPage('budget', { mobileBreakpoint: 500 });
page3.addRow(row => {
row.addTextPanel('header3', {
label: 'Step 3 of 5: Budget & Frequency',
computedValue: () => 'Let\'s find boxes that fit your budget',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addRadioButton('budget', {
label: 'What\'s your monthly subscription budget?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'under-20', name: '💵 Under $20/month' },
{ id: '20-40', name: '💰 $20-40/month' },
{ id: '40-60', name: '💎 $40-60/month' },
{ id: '60-plus', name: '👑 $60+/month (premium boxes)' }
],
onValueChange: (val) => setAnswer('budget', val || '')
});
});
page3.addRow(row => {
row.addRadioButton('frequency', {
label: 'How often would you like to receive boxes?',
isRequired: true,
orientation: 'horizontal',
options: [
{ id: 'monthly', name: 'Monthly' },
{ id: 'bi-monthly', name: 'Bi-monthly' },
{ id: 'quarterly', name: 'Quarterly' },
{ id: 'flexible', name: 'Flexible' }
],
onValueChange: (val) => setAnswer('frequency', val || '')
});
});
// ============ PAGE 4: Results ============
const page4 = pages.addPage('results', { mobileBreakpoint: 500 });
page4.addRow(row => {
row.addTextPanel('header4', {
label: 'Step 4 of 5: Your Top Matches',
computedValue: () => 'Here are the subscription boxes we recommend for you',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addTextPanel('topPick', {
computedValue: () => {
const top = getTopRecommendation();
return `🏆 #1 Pick: ${top.name}`;
},
customStyles: {
fontSize: '1.4rem',
fontWeight: '700',
textAlign: 'center',
color: '#059669',
padding: '20px',
background: 'linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)',
borderRadius: '12px',
border: '2px solid #10b981'
}
});
});
page4.addRow(row => {
row.addTextPanel('topPickDetails', {
computedValue: () => {
const top = getTopRecommendation();
return `${top.description}\n${top.price}\nBest for: ${top.bestFor}`;
},
customStyles: {
fontSize: '0.95rem',
textAlign: 'center',
whiteSpace: 'pre-line',
marginTop: '0.5rem',
padding: '10px'
}
});
});
// Other recommendations
const alternativesSection = page4.addSubform('alternatives', {
title: '📦 Other Great Options',
isCollapsible: true,
customStyles: {
marginTop: '1rem',
background: '#f9fafb',
borderRadius: '8px'
}
});
alternativesSection.addRow(row => {
row.addTextPanel('otherBoxes', {
computedValue: () => {
const recs = getBoxRecommendations();
return recs.slice(1).map((r, i) =>
`#${i + 2}. ${r.name}\n ${r.description}\n ${r.price}`
).join('\n\n');
},
customStyles: {
fontSize: '0.9rem',
whiteSpace: 'pre-line',
lineHeight: '1.6'
}
});
});
// Tips section
const tipsSection = page4.addSubform('tips', {
title: '💡 Subscription Box Tips',
isCollapsible: true,
customStyles: {
marginTop: '1rem',
background: '#fef3c7',
borderRadius: '8px'
}
});
tipsSection.addRow(row => {
row.addTextPanel('tipsList', {
computedValue: () =>
'• Look for first-box discounts (many offer 50%+ off)\n' +
'• Read cancellation policies before subscribing\n' +
'• Annual plans often save 15-20%\n' +
'• Follow boxes on social for spoilers & deals\n' +
'• Gift subscriptions are great for hard-to-shop-for people',
customStyles: {
fontSize: '0.9rem',
whiteSpace: 'pre-line',
lineHeight: '1.7'
}
});
});
// ============ PAGE 5: Lead Capture ============
const page5 = pages.addPage('lead-capture', { mobileBreakpoint: 500 });
page5.addRow(row => {
row.addTextPanel('header5', {
label: 'Get Your Complete Subscription Guide',
computedValue: () => 'Receive comparison charts and exclusive discount codes',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page5.addSpacer({ height: '24px' });
page5.addRow(row => {
row.addTextbox('name', {
label: 'Your Name',
isRequired: true,
placeholder: 'Emma Wilson'
}, '1fr');
row.addEmail('email', {
label: 'Email Address',
isRequired: true,
placeholder: 'emma@email.com'
}, '1fr');
});
page5.addRow(row => {
row.addCheckboxList('consent', {
options: [
{ id: 'guide', name: '📧 Send me my subscription box guide (PDF)', isRequired: true },
{ id: 'deals', name: '🏷️ Exclusive discount codes & first-box deals' },
{ id: 'new', name: '✨ New box launches and reviews' }
],
defaultValue: ['guide'],
orientation: 'vertical'
});
});
// ============ PDF REPORT ============
form.configurePdf('subscription-report', pdf => {
pdf.configure({
filename: 'your-subscription-box-guide.pdf',
pageSize: 'A4',
allowUserDownload: true,
downloadButtonLabel: '📄 Download Subscription Guide',
header: {
title: 'Your Subscription Box Guide',
subtitle: 'Personalized recommendations & deals'
},
footer: {
text: 'Generated by FormTs Subscription Finder',
showPageNumbers: true
}
});
pdf.addSection('Your Preferences', section => {
section.addRow(row => {
row.addField('Category', (answers()['category'] as string) || 'Not specified');
row.addField('Budget', (answers()['budget'] as string) || 'Not specified');
});
section.addRow(row => {
row.addField('Frequency', (answers()['frequency'] as string) || 'Not specified');
row.addField('Purpose', (answers()['purpose'] as string) || 'Not specified');
});
});
pdf.addSection('Top Recommendations', section => {
const recs = getBoxRecommendations();
section.addTable(
['Rank', 'Box Name', 'Price', 'Best For'],
recs.map((r, i) => [`#${i + 1}`, r.name, r.price, r.bestFor])
);
});
pdf.addSection('Money-Saving Tips', section => {
section.addText('1. Sign up for first-box discounts (often 40-50% off)');
section.addText('2. Choose annual billing for 15-20% savings');
section.addText('3. Use referral codes from friends or influencers');
section.addText('4. Watch for Black Friday and holiday sales');
section.addText('5. Skip months you don\'t need (if allowed)');
});
pdf.addSection('Red Flags to Avoid', section => {
section.addText('• No clear cancellation policy');
section.addText('• Forced multi-month commitments');
section.addText('• No customer reviews available');
section.addText('• Hidden shipping costs');
});
});
// ============ SUBMIT BUTTON ============
form.configureSubmitButton({
label: () => '📦 Get My Subscription Guide'
});
form.configureSubmitBehavior({
sendToServer: true
});
}