Welcome questions side preview — Onboarding block

Free

onboarding-welcome-questions-side-preview · for app, onboarding pages

Welcome questions side preview

A wide screen where the answers shape what comes next: the questions as lists on the left, a quiet panel on the right summing up the answers so far.

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/onboarding-welcome-questions-side-preview

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import OnboardingWelcomeQuestionsSidePreview from '@/components/trame/blocks/onboarding/onboarding-welcome-questions-side-preview.vue'

const props = {
title: "Tell us about your work",
intro: "Three quick questions, so Larkpad opens on what matters to you. You can change them later in Settings.",
questions: [
{
id: "role",
label: "What best describes your role?",
hint: "We use it to suggest your first project.",
kind: "single",
required: true,
choices: [
{
value: "design",
label: "Design",
description: "Interfaces, brand and print",
icon: "palette"
},
{
value: "engineering",
label: "Engineering",
description: "Code, reviews and releases",
icon: "code"
}
]
},
{
id: "teamSize",
label: "How many people will work in Larkpad?",
kind: "single",
required: true,
choices: [
{
value: "1",
label: "Just me",
icon: "user"
},
{
value: "2-10",
label: "2 to 10",
icon: "users"
}
]
}
],
fields: [
{
name: "workspace",
label: "Workspace name",
placeholder: "e.g. Design team",
required: true
}
],
submit: {
label: "Create workspace",
action: "onboarding.save"
},
skip: {
label: "Skip for now",
action: "app.home"
}
}
</script>

<template>
<OnboardingWelcomeQuestionsSidePreview v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe step’s heading ("Tell us about your work")
introstringWordsone line under the heading on what the answers change
questions*Question[]the questions, 1 to 6, in the order they are asked
fieldsField[]up to two plain text fields asked after the questions, usually the workspace’s name
submit*Submitthe button that sends the answers, and the page action it runs
skipSkipa quiet way past the questions, e.g. "Skip for now"
valuesRecord<string, string | string[]>Dataanswers already given, by question id or field name (a list for a multiple question): shown picked or filled in
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Question questions[] · 6 props
PropTypeDescription
id*stringDesignthe question’s key: the name its answer is sent under ("role")
label*stringWordsthe question itself ("What best describes your role?")
hintstringWordsone line under the question on why it is asked ("We use it to suggest a first project")
kind*'single' | 'multiple'Designsingle: one answer (radio cards), sent as one value; multiple: any number (checkbox cards), sent as a list
choices*Choice[]the answers to pick from, 2 to 12, in the order shown
requiredbooleantrue: the form cannot be sent without an answer; said in words beside the question
Choice questions[].choices[] · 4 props
PropTypeDescription
value*stringDesignwhat is sent for this choice under the question’s id ("design")
label*stringWordsthe choice as a person reads it ("Design")
descriptionstringWordsa few words under the label ("Mockups, brand and interfaces")
iconstringDesigna small picture beside the label, one of: user, users, team, building, briefcase, code, palette, megaphone, chart, rocket, school, heart, sparkles, wrench, headset, shopping, calendar, pen, globe, layers, target; none when absent or unknown
Field fields[] · 4 props
PropTypeDescription
name*stringDesignthe field’s key in what the form sends ("workspace")
label*stringWordswhat the field asks ("Workspace name")
placeholderstringWordsthe shape expected, never a value that looks real ("e.g. Design team")
requiredbooleantrue: the form cannot be sent with the field empty
Submit submit · 2 props
PropTypeDescription
label*stringWordsthe final button ("Create workspace")
action*stringActionreceives the answers: each question’s id with its value (a list for a multiple one) and each field’s name with its text; posted natively, the same names. Without it, or when the page lacks it, the button is not shown
Skip skip · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Options options · 1 props
PropTypeDescription
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: form.submit, skip

A onboarding section, for app, onboarding pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More onboarding blocks

  • Checklist cards: a few substantial steps, each a row card with its number and a button on the current one.
  • Checklist preview: A selectable step list beside its explanation and action, using the account’s real completion states.
  • Checklist rail: a new account’s set-up as a vertical path: done steps checked, the current one with its action, the rest dashed.
  • Checklist ring: A compact setup card with a static completion ring and every account step visible.
  • Setup progress compact: a quiet checklist on the app home: one line per step, a progress bar and the next step when almost done.
  • Template picker gallery: An empty workspace or a "New" page with six templates or more: a filterable grid of preview cards, "Start from scratch" first.
  • Template picker list preview: Templates whose look decides the choice (documents, sites, boards): a list of names on the left, the chosen template’s large preview and its action on the right.

All 10 onboarding blocks