BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/nativeui/popover

Popover

nativeui/popover
FreeComponent

A popover component for React Native applications.

Live preview

live · rendered by the registry
Rendered by nativeui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://nativeui.ribbi.ch/r/popover.json

Source

registry/popover/popover.tsxnativeui.ribbi.ch/r/popover.json · first 6 KB
1import * as React from "react"
2import {
3 View,
4 Text,
5 Pressable,
6 Modal,
7 TouchableWithoutFeedback,
8 Platform,
9 Animated,
10} from "react-native"
11import { cn } from "@/lib/utils"
12
13interface PopoverProps {
14 children: React.ReactNode
15 className?: string
16}
17
18interface PopoverTriggerProps {
19 children: React.ReactNode
20 className?: string
21 disabled?: boolean
22 asChild?: boolean
23}
24
25interface PopoverAnchorProps {
26 children: React.ReactNode
27 className?: string
28}
29
30interface PopoverContentProps {
31 children: React.ReactNode
32 className?: string
33 align?: "start" | "center" | "end"
34 side?: "top" | "right" | "bottom" | "left"
35 sideOffset?: number
36}
37
38const PopoverContext = React.createContext<{
39 open: boolean
40 setOpen: React.Dispatch<React.SetStateAction<boolean>>
41 triggerRef: React.RefObject<View>
42 triggerLayout: { x: number; y: number; width: number; height: number } | null
43 setTriggerLayout: React.Dispatch<React.SetStateAction<{ x: number; y: number; width: number; height: number } | null>>
44 contentLayout: { width: number; height: number } | null
45 setContentLayout: React.Dispatch<React.SetStateAction<{ width: number; height: number } | null>>
46 isAnimating: boolean
47 setIsAnimating: React.Dispatch<React.SetStateAction<boolean>>
48}>({
49 open: false,
50 setOpen: () => { },
51 triggerRef: { current: null },
52 triggerLayout: null,
53 setTriggerLayout: () => { },
54 contentLayout: null,
55 setContentLayout: () => { },
56 isAnimating: false,
57 setIsAnimating: () => { },
58})
59
60const Popover = React.forwardRef<View, PopoverProps>(
61 ({ children, className, ...props }, ref) => {
62 const [open, setOpen] = React.useState(false)
63 const triggerRef = React.useRef<View>(null)
64 const [triggerLayout, setTriggerLayout] = React.useState<{ x: number; y: number; width: number; height: number } | null>(null)
65 const [contentLayout, setContentLayout] = React.useState<{ width: number; height: number } | null>(null)
66 const [isAnimating, setIsAnimating] = React.useState(false)
67
68 return (
69 <PopoverContext.Provider
70 value={{
71 open,
72 setOpen,
73 triggerRef,
74 triggerLayout,
75 setTriggerLayout,
76 contentLayout,
77 setContentLayout,
78 isAnimating,
79 setIsAnimating,
80 }}
81 >
82 <View ref={ref} className={cn("", className)} {...props}>
83 {children}
84 </View>
85 </PopoverContext.Provider>
86 )
87 }
88)
89
90Popover.displayName = "Popover"
91
92// … truncated

What it pulls in

npm packages

  • react-native

Files it writes

  • registry/popover/popover.tsx

Facts

Registry
nativeui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on nativeui nativeui.ribbi.ch nativeui-org/ui on GitHub Raw registry item This item as JSON

More from nativeui

All 29 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionnativeuiComponentsFree2 deps
AlertalertnativeuiComponentsFree2 deps
Alert Dialogalert-dialognativeuiComponentsFree1 dep
AvataravatarnativeuiComponentsFree1 dep
BadgebadgenativeuiComponentsFree2 deps
BreadcrumbbreadcrumbnativeuiComponentsFree2 deps
ButtonbuttonnativeuiComponentsFree2 deps
CalendarcalendarnativeuiComponentsFree4 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex