popover
shipbase-ui/popoverFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/popover.jsonSource
1"use client"23import * as React from "react"45import { Popover as PopoverPrimitive } from "@ark-ui/react/popover"6import { Portal } from "@ark-ui/react/portal"78import { cn } from "@/lib/utils"910const Popover = PopoverPrimitive.Root1112const PopoverAnchor = PopoverPrimitive.Anchor1314const PopoverArrow = React.forwardRef<15 React.ElementRef<typeof PopoverPrimitive.Arrow>,16 PopoverPrimitive.ArrowProps17>(({ className, ...props }, ref) => (18 <PopoverPrimitive.Arrow19 ref={ref}20 className={cn(21 "[--arrow-background:var(--popover)] [--arrow-size:calc(var(--spacing)*2)]",22 className23 )}24 {...props}25 >26 <PopoverPrimitive.ArrowTip className="border-t border-l" />27 </PopoverPrimitive.Arrow>28))29PopoverArrow.displayName = "PopoverArrow"3031const PopoverCloseTrigger = PopoverPrimitive.CloseTrigger3233const PopoverContent = React.forwardRef<34 React.ElementRef<typeof PopoverPrimitive.Content>,35 PopoverPrimitive.ContentProps36>(({ className, ...props }, ref) => (37 <Portal>38 <PopoverPrimitive.Positioner>39 <PopoverPrimitive.Content40 ref={ref}41 className={cn(42 "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",43 className44 )}45 {...props}46 />47 </PopoverPrimitive.Positioner>48 </Portal>49))50PopoverContent.displayName = "PopoverContent"5152const PopoverContext = PopoverPrimitive.Context5354const PopoverDescription = React.forwardRef<55 React.ElementRef<typeof PopoverPrimitive.Description>,56 PopoverPrimitive.DescriptionProps57>(({ className, ...props }, ref) => (58 <PopoverPrimitive.Description59 ref={ref}60 className={cn("text-muted-foreground text-sm", className)}61 {...props}62 />63))64PopoverDescription.displayName = "PopoverDescription"6566const PopoverRootProvider = PopoverPrimitive.RootProvider6768const PopoverTitle = React.forwardRef<69 React.ElementRef<typeof PopoverPrimitive.Title>,70 PopoverPrimitive.TitleProps71>(({ className, ...props }, ref) => (72 <PopoverPrimitive.Title73 ref={ref}74 className={cn("font-semibold text-lg leading-none", className)}75 {...props}76 />77))78// … truncated
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps |
