Survey
Emoji rating survey component that reports the chosen value and lets the user change or close it.
How to use it
Run npx @blossomui/react add survey, or copy src/components/UI/Survey/Survey.tsx into your React project and import it.
import { defaultOptions, Survey } from './components/ui/Survey'
Props
SurveyOption
| Prop | Type | Description |
|---|
| value (required) | number | |
| emoji (required) | string | |
| label (required) | string | |
SurveyLabels
| Prop | Type | Description |
|---|
| answered (required) | string | |
| change (required) | string | |
| close (required) | string | |
SurveyProps
| Prop | Type | Description |
|---|
| labels | Partial<SurveyLabels> | Texts of the component. Pass only the ones you want to change, for example to translate it. |
| color | string | Accent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default. |
| question (required) | string | |
| options | SurveyOption[] | |
| onSubmit | (value: number) => void | Called with the chosen value when the user answers. |
| thanks | string | Message shown after answering. |