Gathering detailed insights and metrics for @chakra-ui/popper
Gathering detailed insights and metrics for @chakra-ui/popper
Gathering detailed insights and metrics for @chakra-ui/popper
Gathering detailed insights and metrics for @chakra-ui/popper
@chakra-ui/tooltip
A React Component for rendering dynamically positioned Tooltips
@chakra-ui/popover
A React component to render that renders its content in a popover
@chakra-ui/c-popper
Chakra UI Vue | Position engine for vue bult on popperjs core component
@hackr/chakra-ui-popper
A React component and hooks wrapper for popper.js
Chakra UI is a component system for building SaaS products with speed ⚡️
npm install @chakra-ui/popper
Typescript
Module System
Node Version
NPM Version
98.4
Supply Chain
100
Quality
76.2
Maintenance
100
Vulnerability
100
License
@chakra-ui/cli@3.22.0
Updated on Jul 07, 2025
@chakra-ui/panda-preset@3.22.0
Updated on Jul 07, 2025
@chakra-ui/react@3.22.0
Updated on Jul 07, 2025
@chakra-ui/charts@3.22.0
Updated on Jul 07, 2025
@chakra-ui/panda-preset@3.21.1
Updated on Jun 28, 2025
@chakra-ui/charts@3.21.1
Updated on Jun 28, 2025
TypeScript (82.19%)
MDX (16.96%)
JavaScript (0.71%)
CSS (0.07%)
HTML (0.06%)
Dockerfile (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
39,352 Stars
10,957 Commits
3,443 Forks
201 Watchers
10 Branches
694 Contributors
Updated on Jul 12, 2025
Latest Version
3.1.0
Package Id
@chakra-ui/popper@3.1.0
Unpacked Size
140.49 kB
Size
21.33 kB
File Count
36
NPM Version
9.5.1
Node Version
18.16.1
Published on
Jul 18, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
A React hooks wrapper for popper.js to dynamic positioning of containers around a reference.
This is an internal hook of Chakra-UI, and it's not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
1yarn add @chakra-ui/popper
By default, the usePopper
hook returns props for the popper, reference and
arrow.
1import { Box } from "@chakra-ui/layout" 2import { Button } from "@chakra-ui/button" 3import { useDisclosure } from "@chakra-ui/hooks" 4import { usePopper } from "@chakra-ui/popper" 5 6function Example() { 7 const { isOpen, onToggle } = useDisclosure() 8 const { popperRef, referenceRef, getArrowProps } = usePopper() 9 return ( 10 <> 11 <Button ref={referenceRef} onClick={onToggle} mb={2}> 12 {isOpen ? "Click me to see less" : "Click me to see more"} 13 </Button> 14 {isOpen && ( 15 <Box ref={popperRef} bg="red"> 16 <div 17 {...getArrowProps({ 18 style: { 19 background: "red", 20 }, 21 })} 22 /> 23 This is a popover for the button! 24 </Box> 25 )} 26 </> 27 ) 28}
You can change the placement of the popper by passing the placement
option to
usePopper
and set it to the popper.js
placement.
1const { popperRef, referenceRef } = usePopper({ 2 placement: "right-start", 3})
In some cases, you might want to allow the popper take the width of the reference. For example, autocomplete, select, etc.
To achieve this, pass the matchWidth
option and set it to true
1const { popperRef, referenceRef } = usePopper({ 2 matchWidth: true, 3})
You can place the popper next to the reference without margin or distance between them. Useful to create an autocomplete or typeahead feature.
1const { popperRef, referenceRef } = usePopper({ 2 gutter: 0, 3})
If the reference element is inside a fixed container, you should use the fixed
strategy.
1const { popperRef, referenceRef } = usePopper({ 2 strategy: "fixed", 3})
When add transitions to a popper component, it is usually advised to apply popper and transition to different elements.
1// 1. Import components 2import { useDisclosure } from "@chakra-ui/hooks" 3import { usePopper } from "@chakra-ui/popper" 4import { motion, AnimatePresence, Variants } from "framer-motion" 5 6export function Example() { 7 // 2. Create toggle state 8 const { isOpen, onToggle } = useDisclosure() 9 10 // 3. Create motion variants 11 const slide: Variants = { 12 exit: { 13 y: -2, 14 opacity: 0, 15 }, 16 enter: { 17 y: 0, 18 opacity: 1, 19 }, 20 } 21 22 // 4. Consume the `usePopper` hook 23 const { getPopperProps, getReferenceProps, getArrowProps, transformOrigin } = 24 usePopper({ 25 placement: "bottom-start", 26 }) 27 28 return ( 29 <> 30 <button {...getReferenceProps({ onClick: onToggle })}>Toggle</button> 31 <div {...getPopperProps()}> 32 <AnimatePresence> 33 {isOpen && ( 34 <motion.div 35 transition={{ 36 type: "spring", 37 duration: 0.2, 38 }} 39 variants={slide} 40 initial="exit" 41 animate="enter" 42 exit="exit" 43 style={{ 44 background: "red", 45 width: 200, 46 transformOrigin, 47 borderRadius: 4, 48 }} 49 > 50 Testing 51 <div 52 {...getArrowProps({ 53 style: { 54 background: "red", 55 }, 56 })} 57 /> 58 </motion.div> 59 )} 60 </AnimatePresence> 61 </div> 62 </> 63 ) 64}
When not rendering the popper conditionally, we recommend using
visibility: hidden
instead ofhidden
ordisplay: none
No vulnerabilities found.
Reason
30 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
7 existing vulnerabilities detected
Details
Reason
Found 5/25 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More