Welcome questions side preview — Onboarding block
Freeonboarding-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-previewUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe step’s heading ("Tell us about your work") |
| intro | string | Wordsone line under the heading on what the answers change |
| questions* | Question[] | the questions, 1 to 6, in the order they are asked |
| fields | Field[] | up to two plain text fields asked after the questions, usually the workspace’s name |
| submit* | Submit | the button that sends the answers, and the page action it runs |
| skip | Skip | a quiet way past the questions, e.g. "Skip for now" |
| values | Record<string, string | string[]> | Dataanswers already given, by question id or field name (a list for a multiple question): shown picked or filled in |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Question questions[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe question’s key: the name its answer is sent under ("role") |
| label* | string | Wordsthe question itself ("What best describes your role?") |
| hint | string | Wordsone 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 |
| required | boolean | true: the form cannot be sent without an answer; said in words beside the question |
Choice questions[].choices[] · 4 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Designwhat is sent for this choice under the question’s id ("design") |
| label* | string | Wordsthe choice as a person reads it ("Design") |
| description | string | Wordsa few words under the label ("Mockups, brand and interfaces") |
| icon | string | Designa 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
| Prop | Type | Description |
|---|---|---|
| name* | string | Designthe field’s key in what the form sends ("workspace") |
| label* | string | Wordswhat the field asks ("Workspace name") |
| placeholder | string | Wordsthe shape expected, never a value that looks real ("e.g. Design team") |
| required | boolean | true: the form cannot be sent with the field empty |
Submit submit · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe final button ("Create workspace") |
| action* | string | Actionreceives 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
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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.