Desktops have one layout. On phones and tablets the same markup can also lay itself out like a native app: or .
Code
Copy it into a page of your app. Load the CSS and register the components once (see framework setup); links point at routes like /orders that you replace with your own.
This template works: the page renders from data.ts (sample rows, replace them with your API) and behavior.ts makes its controls work. The behaviour file is the same in every framework.
<script type="module">
import '@prismora/css';
import '@prismora/elements/button';
import '@prismora/elements/card';
import '@prismora/elements/checkbox-group';
import '@prismora/elements/drawer';
import '@prismora/elements/icon';
import '@prismora/elements/input';
import '@prismora/elements/progress';
import '@prismora/elements/radio-group';
import '@prismora/elements/rating';
import '@prismora/elements/result';
import '@prismora/elements/switch';
import '@prismora/elements/textarea';
import '@prismora/elements/theme-settings';
import '@prismora/elements/theme-switch';
import '@prismora/elements/toggle-group';
import { registerIcons } from '@prismora/elements/icon';
import { mail, send, settings, zap } from '@prismora/icons';
import { data } from './prismora/survey/data';
import { setup } from './prismora/survey/behavior';
registerIcons([mail, send, settings, zap]);
setup(document.body, data);
</script>
<main class="pm-centered-page" style="--pm-container: 40rem">
<a href="/" class="pm-brand pm-justify-center">
<pm-icon name="zap"></pm-icon>
<span class="pm-brand-name">Lumen</span>
</a>
<div class="pm-stack" data-ref="flow">
<div class="pm-stack pm-gap-2 pm-text-center">
<h1 class="pm-text-3xl pm-heading">Two minutes to make Lumen better</h1>
<p class="pm-muted">Six questions. Your answers go to the product team, not to sales.</p>
</div>
<pm-progress label="Answered" value="0" max="4" size="sm" hide-label data-ref="progress"></pm-progress>
<p class="pm-text-sm pm-muted pm-text-center" data-ref="progress-text">0 of 4 answered</p>
<form class="pm-stack pm-gap-4" novalidate data-ref="form">
<pm-card>
<div class="pm-stack">
<h2 class="pm-text-sm pm-weight-medium" aria-hidden="true">
1. How likely are you to recommend Lumen to a colleague?
<span class="pm-text-danger">*</span>
</h2>
<pm-toggle-group label="1. How likely are you to recommend Lumen to a colleague?" name="score" required data-ref="score">
<pm-toggle value="0">0</pm-toggle>
<pm-toggle value="1">1</pm-toggle>
<pm-toggle value="2">2</pm-toggle>
<pm-toggle value="3">3</pm-toggle>
<pm-toggle value="4">4</pm-toggle>
<pm-toggle value="5">5</pm-toggle>
<pm-toggle value="6">6</pm-toggle>
<pm-toggle value="7">7</pm-toggle>
<pm-toggle value="8">8</pm-toggle>
<pm-toggle value="9">9</pm-toggle>
<pm-toggle value="10">10</pm-toggle>
</pm-toggle-group>
<div class="pm-cluster pm-justify-between pm-text-xs pm-muted">
<span>0: not at all</span>
<span>10: certainly</span>
</div>
<pm-textarea label="What is the main reason for your score?" name="reason" rows="3" maxlength="600" show-count data-ref="reason" hidden></pm-textarea>
</div>
</pm-card>
<pm-card>
<pm-radio-group label="2. How often do you use Lumen?" name="frequency" required data-ref="frequency">
<pm-radio value="daily">Every day</pm-radio>
<pm-radio value="weekly">A few times a week</pm-radio>
<pm-radio value="monthly">A few times a month</pm-radio>
<pm-radio value="rarely">Hardly ever</pm-radio>
</pm-radio-group>
</pm-card>
<pm-card>
<pm-checkbox-group label="3. Which parts do you use?" hint="Choose all that apply." name="parts" required data-ref="parts">
<pm-choice value="roadmap">Roadmaps</pm-choice>
<pm-choice value="tasks">Tasks and boards</pm-choice>
<pm-choice value="reports">Reports</pm-choice>
<pm-choice value="integrations">Integrations</pm-choice>
<pm-choice value="mobile">The mobile app</pm-choice>
</pm-checkbox-group>
</pm-card>
<pm-card>
<div class="pm-stack" data-ref="ratings">
<h2 class="pm-text-sm pm-weight-medium">
4. How do you rate these?
<span class="pm-text-danger" aria-hidden="true">*</span>
</h2>
<div class="pm-cluster pm-justify-between">
<span>Speed</span>
<pm-rating label="Speed" name="speed" data-aspect="speed"></pm-rating>
</div>
<div class="pm-cluster pm-justify-between">
<span>Ease of use</span>
<pm-rating label="Ease of use" name="ease" data-aspect="ease"></pm-rating>
</div>
<div class="pm-cluster pm-justify-between">
<span>Support</span>
<pm-rating label="Support" name="support" data-aspect="support"></pm-rating>
</div>
<p class="pm-text-sm pm-text-danger" role="alert" data-ref="ratings-error" hidden>Rate all three.</p>
</div>
</pm-card>
<pm-card>
<div class="pm-stack">
<pm-switch label="5. You may contact me about my answers" data-ref="contact"></pm-switch>
<pm-input label="Email" type="email" name="email" autocomplete="email" icon-start="mail" data-ref="email" hidden></pm-input>
<pm-textarea label="6. Anything else? (optional)" name="more" rows="3" maxlength="600" show-count data-ref="more"></pm-textarea>
</div>
</pm-card>
<div class="pm-cluster pm-justify-between">
<pm-button variant="ghost" tone="neutral" data-action="clear">Clear my answers</pm-button>
<pm-button type="submit" size="lg" icon-end="send" data-ref="submit">Send my answers</pm-button>
</div>
</form>
</div>
<pm-result status="success" heading="Thank you" heading-level="1" data-ref="done" hidden>
<pm-button variant="outline" tone="neutral" data-action="edit">Change my answers</pm-button>
<pm-button href="/" variant="ghost" tone="neutral">Back to Lumen</pm-button>
</pm-result>
</main>
<div class="pm-display-corner">
<pm-theme-switch size="sm" class="pm-site-wide" variant="toggle"></pm-theme-switch>
<pm-button size="sm" variant="ghost" tone="neutral" icon icon-start="settings" label="Display settings" commandfor="display-settings" command="--open"></pm-button>
</div>
<pm-drawer id="display-settings" heading="Display settings" description="Saved in this browser." side="end">
<pm-theme-settings></pm-theme-settings>
</pm-drawer>
With the CLI
npx @prismora/cli add survey --write
Writes the page into your routes folder and both files into prismora/survey/.