shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Feedback Popover for React
A Feedback button that opens a popover with a message box and a submit button.
A Feedback button that opens a small form: a title, a line of encouragement, a message box and a full-width Submit Feedback button. Collect a comment in place, without sending people to a separate page. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
How is the feedback field set up?
The Textarea has aria-label="Feedback", placeholder="Share your feedback...", and className="min-h-24". It leaves value and onChange unset. PopoverContent is w-80 max-w-full.
How do I close this panel from code?
Submit Feedback closes the panel.
Here the panel is controlled: open and onOpenChange on Popover, and the button's handler sets the state to false. The callback gets the next open state first.
What is the heading on the feedback panel?
PopoverHeader wraps PopoverTitle reading Send Feedback and PopoverDescription reading We'd love to hear your thoughts! The textarea and the full-width Submit Feedback button follow.
How does the Feedback button become the trigger?
The trigger is a Button with variant="outline". MessageSquareIcon has aria-hidden="true" and data-icon="inline-start", and the label is Feedback.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
Related
- Popover with FormA Settings popover with a text input and
- Popover with FooterA popover with a title, a line of text
- Simple TextareaA plain textarea with a placeholder and
- Standard DialogA share dialog with a read-only link, a
- Button with Text (Standard)The one filled action
- Compact PopoverA small question-mark button that opens a