Carregando…
Carregando…
Carregando…Dynamic survey with text, textarea, radio, checkbox, scale and rating question types — all-at-once or one-at-a-time.
$ npx kikitocn add survey-form@/lib/utils@/components/ui/cn/button@/components/ui/cn/progressimport { SurveyForm } from "@/components/ui/cn/survey-form/SurveyForm";
export function SurveyFormExample() {
return (
<SurveyForm layout="all" />
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
questions* | SurveyQuestion[] | — | Lista de perguntas: { id, label, type, required?, options?, placeholder? } |
title | string | undefined | Título da pesquisa |
description | string | undefined | Descrição/instrução da pesquisa |
layout | 'all' | 'single' | 'all' | 'all': todas as perguntas na mesma página (original). 'single': 1 pergunta por vez, com barra de progresso e Anterior/Próxima — padrão Questionnaire |
allowSkip | boolean | false | Só em layout='single': mostra botão 'Pular' na pergunta atual quando ela não é obrigatória |
onSubmit | (answers: Record<string, unknown>) => void | undefined | Callback com as respostas ao enviar |
submitLabel | string | 'Enviar respostas' | Texto do botão de envio |
className | string | — | Classes extras pro form raiz |
style | CSSProperties | — | Estilos inline pro form raiz |
Survey Form — multiple question types
1 pergunta por vez — progresso + Anterior/Próxima, Pular quando não obrigatória