Orbeez kit
Agents & tools

Questionnaire

<Questionnaire />
An agent asking what it needs to know before it goes on: options to pick, words to write, or both, sent together.
A few things before I start on dark mode3 questions
Which pages should it cover?
Where should the toggle go?
It follows the system until someone picks.
Anything to keep as it is?optional

Install

npx shadcn@latest add https://orbeez-kit.vercel.app/r/questionnaire.json

Usage

tsx
<Questionnaire
  title="A few things before I start"
  hue={agent.hue}
  questions={[
    { id: 'scope', label: 'Which pages?', options: [{ value: 'all', label: 'Every page' }, { value: 'app', label: 'The app' }], other: 'Somewhere else…' },
    { id: 'toggle', label: 'Where should the toggle go?', multiple: true, options: [...] },
    { id: 'notes', label: 'Anything to keep?', optional: true },
  ]}
  onSubmit={(answers) => resume(answers)}   // { scope: 'all', toggle: ['header'], notes: '' }
  onSkip={() => resume()}
/>

Good to know

  • Moods. Confused while it asks; a tick once answered; quiet if skipped.
  • A question with options takes one answer, or any number with multiple. other adds a field for an answer in words, with that placeholder; writing in it picks it.
  • A question with no options is answered in words.
  • Send waits until every question not marked optional is answered. Enter in any field sends too.
  • Give it the asking agent's hue. Left out, it is amber, for waiting on someone.

Behaviour

  • Picking an option changes its colour, an outline and the mark in its fixed box. Never its weight, padding or width, so no option after it moves.
  • Sending or skipping swaps the buttons for a line of the same height, so the card keeps its size.
  • A single choice is one tab stop, and the arrow keys move through it and pick, as radios do.
  • With reduced motion the swaps only fade.