Popover
animate-ui/components-base-popoverFreeComponent
An accessible popup anchored to a button.
Install it
npx shadcn@latest add https://animate-ui.com/r/components-base-popover.jsonSource
1import * as React from 'react';23import {4 Popover as PopoverPrimitive,5 PopoverTrigger as PopoverTriggerPrimitive,6 PopoverPositioner as PopoverPositionerPrimitive,7 PopoverPopup as PopoverPopupPrimitive,8 PopoverPortal as PopoverPortalPrimitive,9 PopoverClose as PopoverClosePrimitive,10 PopoverBackdrop as PopoverBackdropPrimitive,11 PopoverTitle as PopoverTitlePrimitive,12 PopoverDescription as PopoverDescriptionPrimitive,13 type PopoverProps as PopoverPrimitiveProps,14 type PopoverTriggerProps as PopoverTriggerPrimitiveProps,15 type PopoverPositionerProps as PopoverPositionerPrimitiveProps,16 type PopoverPopupProps as PopoverPopupPrimitiveProps,17 type PopoverCloseProps as PopoverClosePrimitiveProps,18 type PopoverBackdropProps as PopoverBackdropPrimitiveProps,19 type PopoverTitleProps as PopoverTitlePrimitiveProps,20 type PopoverDescriptionProps as PopoverDescriptionPrimitiveProps,21} from '@/components/animate-ui/primitives/base/popover';22import { cn } from '@/lib/utils';2324type PopoverProps = PopoverPrimitiveProps;2526function Popover(props: PopoverProps) {27 return <PopoverPrimitive {...props} />;28}2930type PopoverTriggerProps = PopoverTriggerPrimitiveProps;3132function PopoverTrigger(props: PopoverTriggerProps) {33 return <PopoverTriggerPrimitive {...props} />;34}3536type PopoverPanelProps = PopoverPositionerPrimitiveProps &37 PopoverPopupPrimitiveProps;3839function PopoverPanel({40 className,41 align = 'center',42 sideOffset = 4,43 initialFocus,44 finalFocus,45 style,46 children,47 ...props48}: PopoverPanelProps) {49 return (50 <PopoverPortalPrimitive>51 <PopoverPositionerPrimitive52 align={align}53 sideOffset={sideOffset}54 className="z-50"55 {...props}56 >57 <PopoverPopupPrimitive58 initialFocus={initialFocus}59 finalFocus={finalFocus}60 className={cn(61 'bg-popover text-popover-foreground w-72 rounded-md border p-4 shadow-md outline-hidden origin-(--transform-origin)',62 className,63 )}64 style={style}65 >66 {children}67 </PopoverPopupPrimitive>68 </PopoverPositionerPrimitive>69 </PopoverPortalPrimitive>70 );71}7273type PopoverCloseProps = PopoverClosePrimitiveProps;7475function PopoverClose(props: PopoverCloseProps) {76 return <PopoverClosePrimitive {...props} />;77}7879type PopoverBackdropProps = PopoverBackdropPrimitiveProps;8081function PopoverBackdrop(props: PopoverBackdropProps) {82 return <PopoverBackdropPrimitive {...props} />;83}84// … truncated
What it pulls in
Other registry items
Files it writes
More from Animate UI
All 580 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Groupcomponents-animate-avatar-group | Animate UI | Components | Free | 1 dep | |
| Codecomponents-animate-code | Animate UI | Components | Free | 1 dep | |
| Code Tabscomponents-animate-code-tabs | Animate UI | Components | Free | 1 dep | |
| Cursorcomponents-animate-cursor | Animate UI | Components | Free | no deps | |
| GitHub Stars Wheelcomponents-animate-github-stars-wheel | Animate UI | Components | Free | 1 dep | |
| Tabscomponents-animate-tabs | Animate UI | Components | Free | no deps | |
| Tooltipcomponents-animate-tooltip | Animate UI | Components | Free | 1 dep | |
| Bubble Backgroundcomponents-backgrounds-bubble | Animate UI | Components | Free | 1 dep |
