@letar/forms

Conversational Mode

Typeform-style one-question-at-a-time form experience with animations

Overview

Conversational Mode shows one field at a time with smooth animations, a progress bar, and keyboard-first navigation. Ideal for surveys, onboarding, and marketing forms where higher completion rates matter.

Basic Usage

<Form initialValue={data} onSubmit={handleSubmit}>
  <ConversationalMode showProgress showQuestionNumber>
    <Form.Field.String name="name" label="What's your name?" />
    <Form.Field.String name="email" label="Your email?" />
    <Form.Field.YesNo name="subscribe" label="Subscribe to updates?" />
  </ConversationalMode>
</Form>

Each child element becomes one step. The user sees one field at a time and navigates with Enter or buttons.

Props

PropTypeDefaultDescription
showProgressbooleantrueShow progress bar
showQuestionNumberbooleantrueShow "Question 3 of 7"
nextLabelstring'Далее'Next button text
prevLabelstring'Назад'Previous button text
submitLabelstring'Отправить'Submit button text (last step)
welcomeScreenReactNodeContent before first question
completedScreenReactNodeContent after last question
onComplete() => voidCalled when all questions answered

Keyboard Navigation

KeyAction
EnterNext question
Alt + Arrow DownNext question
Alt + Arrow UpPrevious question

Custom Hook

For building your own conversational UI:

import { useConversationalState } from '@letar/forms'

const state = useConversationalState(5) // 5 fields
state.currentIndex  // 0
state.progress      // 0.2
state.next()        // go to next
state.prev()        // go to previous
state.isCompleted   // false

Live Example

Try the interactive example on forms-example.letar.best.

On this page