export function firstUseExperience(form: FormTs) {
// First Use Experience Survey - Capturing new user impressions
// Demonstrates: EmojiRating, StarRating, Pages (multi-page), ThumbRating, SuggestionChips
// ============================================
// MULTI-PAGE WIZARD
// ============================================
const pages = form.addPages('wizard', { heightMode: 'tallest-page' });
// ============================================
// PAGE 1: Welcome & First Impression
// ============================================
const page1 = pages.addPage('impression');
page1.addRow(row => {
row.addTextPanel('welcomeHeader', {
label: 'How Was Your First Experience?',
computedValue: () => 'We\'d love to hear about your first time using our product!',
customStyles: {
background: 'linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%)',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
const impressionSection = page1.addSubform('impressionSection', {
title: 'First Impressions'
});
impressionSection.addRow(row => {
row.addEmojiRating('firstFeeling', {
label: 'How do you feel after your first experience with us?',
preset: 'satisfaction',
size: 'lg',
showLabels: true,
alignment: 'center',
isRequired: true
});
});
impressionSection.addRow(row => {
row.addTextPanel('feedbackPrompt', {
label: '',
computedValue: () => {
const feeling = impressionSection.emojiRating('firstFeeling')?.value();
if (feeling === 'excellent' || feeling === 'good') {
return '🎉 Great to hear! What made it special?';
} else if (feeling === 'neutral') {
return '🤔 We can do better! What would improve your experience?';
} else if (feeling === 'bad' || feeling === 'very-bad') {
return '😔 We\'re sorry to hear that. Please help us understand what went wrong.';
}
return '';
},
customStyles: () => {
const feeling = impressionSection.emojiRating('firstFeeling')?.value();
if (!feeling) return { display: 'none' };
return {
textAlign: 'center',
fontSize: '16px',
padding: '12px',
backgroundColor: '#f8fafc',
borderRadius: '8px',
marginTop: '8px'
};
},
isVisible: () => !!impressionSection.emojiRating('firstFeeling')?.value()
});
});
impressionSection.addRow(row => {
row.addStarRating('overallEase', {
label: 'How easy was it to get started?',
maxStars: 5,
size: 'lg',
alignment: 'center',
showCounter: true
});
});
// ============================================
// PAGE 2: Journey Step Ratings
// ============================================
const page2 = pages.addPage('journey');
page2.addRow(row => {
row.addTextPanel('journeyHeader', {
label: 'Your Onboarding Journey',
computedValue: () => 'Help us understand how each step felt.',
customStyles: {
backgroundColor: '#6366f1',
color: 'white',
padding: '20px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
const journeySection = page2.addSubform('journey', {
title: 'Rate Each Step'
});
journeySection.addRow(row => {
row.addMatrixQuestion('journeySteps', {
label: 'How was your experience with each onboarding step?',
rows: [
{ id: 'signup', label: 'Sign-up Process', isRequired: true },
{ id: 'setup', label: 'Initial Setup', isRequired: true },
{ id: 'tutorial', label: 'Tutorial/Walkthrough', isRequired: true },
{ id: 'first-action', label: 'First Main Action', isRequired: true },
{ id: 'navigation', label: 'Finding Your Way Around', isRequired: true }
],
columns: [
{ id: 'frustrating', label: '😫' },
{ id: 'difficult', label: '😕' },
{ id: 'okay', label: '😐' },
{ id: 'easy', label: '🙂' },
{ id: 'delightful', label: '🤩' }
],
fullWidth: true
});
});
journeySection.addSpacer();
journeySection.addRow(row => {
row.addThumbRating('foundEverything', {
label: 'Did you find everything you needed to get started?',
showLabels: true,
upLabel: 'Yes',
downLabel: 'No',
size: 'lg',
alignment: 'center'
});
});
// ============================================
// PAGE 3: Friction Points & Details
// ============================================
const page3 = pages.addPage('friction');
page3.addRow(row => {
row.addTextPanel('frictionHeader', {
label: 'Help Us Improve',
computedValue: () => 'Your feedback helps us make the experience better for everyone.',
customStyles: {
backgroundColor: '#f59e0b',
color: 'white',
padding: '20px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
const frictionSection = page3.addSubform('friction', {
title: 'What Could Be Better?'
});
frictionSection.addRow(row => {
row.addSuggestionChips('frictionAreas', {
label: 'Did you experience any of these issues? (Select all that apply)',
suggestions: [
{ id: 'confusing-ui', name: 'Confusing interface' },
{ id: 'too-many-steps', name: 'Too many steps' },
{ id: 'unclear-instructions', name: 'Unclear instructions' },
{ id: 'slow-loading', name: 'Slow loading' },
{ id: 'missing-features', name: 'Missing features' },
{ id: 'technical-issues', name: 'Technical issues' },
{ id: 'no-issues', name: 'No issues at all!' }
],
alignment: 'center'
});
});
frictionSection.addSpacer();
frictionSection.addRow(row => {
row.addTextarea('confusionDetails', {
label: () => {
const areas = frictionSection.suggestionChips('frictionAreas')?.value() || [];
if (areas.includes('no-issues')) {
return 'What did you like most about the experience?';
}
return 'Can you tell us more about what was confusing or difficult?';
},
placeholder: () => {
const areas = frictionSection.suggestionChips('frictionAreas')?.value() || [];
if (areas.includes('no-issues')) {
return 'Share what made it great...';
}
return 'The more details, the better we can improve...';
},
rows: 3,
autoExpand: true
});
});
// Positive highlights section
const positiveSection = page3.addSubform('positive', {
title: 'What Impressed You?',
isVisible: () => {
const feeling = impressionSection.emojiRating('firstFeeling')?.value();
return feeling === 'excellent' || feeling === 'good';
}
});
positiveSection.addRow(row => {
row.addSuggestionChips('highlights', {
label: 'What stood out positively?',
suggestions: [
{ id: 'design', name: 'Clean design' },
{ id: 'speed', name: 'Fast & responsive' },
{ id: 'intuitive', name: 'Intuitive to use' },
{ id: 'helpful-tips', name: 'Helpful tips' },
{ id: 'powerful', name: 'Powerful features' },
{ id: 'simple', name: 'Simple & straightforward' }
],
max: 3,
alignment: 'center'
});
});
// ============================================
// PAGE 4: Future Intent & Wrap-up
// ============================================
const page4 = pages.addPage('intent');
page4.addRow(row => {
row.addTextPanel('intentHeader', {
label: 'Looking Forward',
computedValue: () => 'One last question before we finish!',
customStyles: {
backgroundColor: '#10b981',
color: 'white',
padding: '20px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
const intentSection = page4.addSubform('intent', {
title: 'Your Next Steps'
});
intentSection.addRow(row => {
row.addRatingScale('continueIntent', {
label: 'How likely are you to continue using our product?',
preset: 'nps',
showSegmentColors: true,
showCategoryLabel: true,
alignment: 'center'
});
});
intentSection.addRow(row => {
row.addRadioButton('nextAction', {
label: 'What will you do next?',
options: [
{ id: 'explore-more', name: 'Explore more features' },
{ id: 'specific-task', name: 'Complete a specific task' },
{ id: 'invite-team', name: 'Invite my team' },
{ id: 'need-help', name: 'Get help/support' },
{ id: 'not-sure', name: 'Not sure yet' }
],
isVisible: () => {
const intent = intentSection.ratingScale('continueIntent')?.value();
return intent !== null && intent !== undefined && intent >= 5;
}
});
});
intentSection.addRow(row => {
row.addTextarea('helpNeeded', {
label: 'What would help you get more value from our product?',
placeholder: 'Tell us what you need...',
rows: 2,
isVisible: () => {
const intent = intentSection.ratingScale('continueIntent')?.value();
return intent !== null && intent !== undefined && intent < 7;
}
});
});
// ============================================
// SUMMARY SECTION
// ============================================
const summarySection = page4.addSubform('summary', {
title: 'Your Feedback Summary',
isVisible: () => intentSection.ratingScale('continueIntent')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const feeling = impressionSection.emojiRating('firstFeeling')?.value();
const ease = impressionSection.starRating('overallEase')?.value();
const frictionAreas = frictionSection.suggestionChips('frictionAreas')?.value() || [];
const continueIntent = intentSection.ratingScale('continueIntent')?.value();
if (!feeling) return '';
const feelingLabels: Record<string, string> = {
'very-bad': '😢 Very Frustrated',
'bad': '😕 Disappointed',
'neutral': '😐 Neutral',
'good': '😊 Satisfied',
'excellent': '😍 Delighted'
};
let summary = '✨ First Use Summary\n';
summary += '═'.repeat(25) + '\n\n';
summary += `First Impression: ${feelingLabels[feeling] || feeling}\n`;
if (ease) {
summary += `Ease of Getting Started: ${'⭐'.repeat(ease)} (${ease}/5)\n`;
}
if (frictionAreas.length > 0) {
if (frictionAreas.includes('no-issues')) {
summary += '\n✅ No issues reported!';
} else {
summary += `\nFriction Areas: ${frictionAreas.length} identified`;
}
}
if (continueIntent !== null && continueIntent !== undefined) {
const intentCategory = continueIntent >= 9 ? 'Very Likely' :
continueIntent >= 7 ? 'Likely' :
continueIntent >= 5 ? 'Maybe' : 'Unlikely';
summary += `\n\nContinue Intent: ${continueIntent}/10 (${intentCategory})`;
}
return summary;
},
customStyles: () => {
const feeling = impressionSection.emojiRating('firstFeeling')?.value();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (feeling === 'excellent' || feeling === 'good') {
return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
} else if (feeling === 'neutral') {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
} else if (feeling === 'bad' || feeling === 'very-bad') {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
return { ...baseStyles, backgroundColor: '#f1f5f9', borderLeft: '4px solid #64748b' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Complete Feedback'
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank You!',
message: 'Your feedback is invaluable in helping us create a better experience. Enjoy exploring our product!'
});
}