Poll. An interactive reader poll whose submission handler is host-owned.
- Engagement
- Interactive
- Stability · Experimental
- ::postkit-poll
Where do you publish most often?
Select one channel to see the component's feedback state.
91 votes
Usage.
<Poll
question="Where do you publish most often?"
description="Select one channel to see the component's feedback state."
options='[{"id":"site","label":"My own site","votes":42},{"id":"newsletter","label":"A newsletter","votes":31},{"id":"social","label":"Social platforms","votes":18}]'
/>Props. Always in step with the code.
| Prop | Type | Default | Description |
|---|---|---|---|
| questionRequired | string | None | The poll question. |
| description | string | None | Supporting poll copy. |
| optionsRequired | JSON string | None | A JSON array of stable option IDs and labels. |
| totalVotes | number | None | An optional total vote count. |
| selectedId | string | None | An optional initially selected option. |
| Appearance | |||
| size | "sm" | "md" | "lg" | "md" | The component density and type scale. |
| variant | "outline" | "subtle" | "plain" | "subtle" | The component visual treatment. |
Every component also takes unstyled and the part-styling props. Change a default for your whole site with defaults in createPostkit. Part styles
Anatomy. Every part is yours to restyle.
Every part
- root
- question
- description
- options
- option
- optionLabel
- result
- bar
- status
Renderers. One component, everywhere you publish.
- Headless @postkit/reactSupported
- Chakra @postkit/chakraSupported
- Email @postkit/emailAs a link
- Astro @postkit/astroHydrated
- Web components @postkit/elementsPlanned