There are only four components exported from chatty-form
The flow of the UI is as follows.
This is the parent component which has to be wrapped around any of the data capturing components (Input, Select or MultiSelect) to make the form functional. It takes care of the state of the form, handles scroll, orchestrates animations and controls the theme/style of the form.
Each child of ChattyForm must have a diffferent name prop to function properly.
<ChattyForm> <Input name="name" question="Howdy! What's your name?" placeholder="Type your answer" /> </ChattyForm>
<ChattyForm> <Select name="pet" question="Do you like dogs more or cats?" options={[ { label: 'Dogs', value: 'dogs' }, { label: 'Cats', value: 'cats' }, ]} /> </ChattyForm>
<ChattyForm> <MultiSelect name="multi" question="Which of these are fruits?" options={[ { label: 'Pumpkins', value: 'pumpkins' }, { label: 'Peppers', value: 'peppers' }, { label: 'Cucumber', value: 'cucumber' }, { label: 'Tomato ', value: 'tomato' }, { label: 'Peas ', value: 'peas' }, ]} /> </ChattyForm>
<ChattyForm disableAutoScroll> <Input name="name" question="Howdy! What's your name?" placeholder="Type your answer" /> <Select name="pet" question="Do you like dogs more or cats?" options={[ { label: 'Dogs', value: 'dogs' }, { label: 'Cats', value: 'cats' }, ]} /> <MultiSelect name="multi" question="Which of these are fruits?" options={[ { label: 'Pumpkins', value: 'pumpkins' }, { label: 'Peppers', value: 'peppers' }, { label: 'Cucumber', value: 'cucumber' }, { label: 'Tomato ', value: 'tomato' }, { label: 'Peas ', value: 'peas' }, ]} /> </ChattyForm>