Gathering detailed insights and metrics for @reactour/utils
Gathering detailed insights and metrics for @reactour/utils
Gathering detailed insights and metrics for @reactour/utils
Gathering detailed insights and metrics for @reactour/utils
npm install @reactour/utils
Typescript
Module System
Node Version
NPM Version
98.6
Supply Chain
98.6
Quality
76.3
Maintenance
100
Vulnerability
100
License
Leaving emotions…
Updated on Aug 12, 2022
Adding new step props: observables + highlight selectors
Updated on Jun 15, 2020
disableFocusLock + roundedMask
Updated on Apr 07, 2020
Custom Helper
Updated on Jan 18, 2019
Add close function into step
Updated on Dec 19, 2018
v1.10.0
Updated on Dec 18, 2018
TypeScript (66.41%)
MDX (16.74%)
JavaScript (14.65%)
CSS (2.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3,951 Stars
777 Commits
355 Forks
22 Watchers
4 Branches
47 Contributors
Updated on Jul 08, 2025
Latest Version
0.5.0
Package Id
@reactour/utils@0.5.0
Unpacked Size
26.00 kB
Size
6.12 kB
File Count
6
NPM Version
8.19.2
Node Version
18.12.1
Published on
Apr 27, 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
2
1
A set of utilities used by @reactour
packages
1npm i -S @reactour/utils 2# or 3yarn add @reacmask/utils
Portal
A handy Portal Component
type?: string
The type of Element to render in the DOM
1import { Portal } from '@reactour/utils' 2function App() { 3 return <Portal type="div">{/* ...*/}</Portal> 4}
Observables
A component used by Tour to handle Mutation and Resize Observer.
mutationObservables?: string[]
Array
of CSS Selector to track mutations
resizeObservables?: string[]
Array
of CSS Selector to track resizing
refresh?: any
Function to fire on each mutation update
1import { Portal } from '@reactour/utils' 2function App() { 3 function refresh() { 4 console.log('mutated!') 5 } 6 return ( 7 <> 8 <p className="mutation-elem">Vestibulum maximus vitae </p> 9 <textarea 10 className="resize-elem" 11 defaultValue="Vestibulum maximus vitae" 12 /> 13 <Observables 14 resizeObservables={['.resize-elem']} 15 mutationObservables={['.mutation-elem']} 16 refresh={refresh} 17 /> 18 {/* ...*/} 19 </> 20 ) 21}
useRect({ ref, refresher })
Calculates Element Bounding Rect by ref
provided
ref?: React.RefObject<T>
Ref attached at the element
refresher?: any
Any value that if changed, updates calculations
1import { useRef } from 'react' 2import { useRect } from '@reactour/utils' 3function App() { 4 const ref = useRef(null) 5 const sizes = useRect(ref) 6 return ( 7 <> 8 <p ref={ref}>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 9 {/* ...*/} 10 </> 11 ) 12}
useElemRect({ elem, refresher })
Same as useRect
but providing an Element
elem?: Element
DOM Element
refresher?: any
Any value that if changed, updates calculations
1import { useElemRect } from '@reactour/utils' 2function App() { 3 const elem = document.querySelector('.elem') 4 const sizes = useElemRect(elem) 5 return ( 6 <> 7 <p class="elem"> 8 Lorem ipsum dolor sit amet, consectetur adipiscing elit. 9 </p> 10 {/* ...*/} 11 </> 12 ) 13}
getRect(element?:Element): RectResult
1type RectResult = { 2 bottom: number 3 height: number 4 left: number 5 right: number 6 top: number 7 width: number 8}
Get Element Bounding Rect from Element
1const elem = documet.querySelector('.elem') 2const sizes = getRect(elem)
getWindow(): { w: number; h: number }
Get window width
and height
1import { getWindow } from '@reactour/utils' 2 3const { w, h } = getWindow()
inView(args: InViewArgs): boolean
1type InViewArgs = { 2 width: number 3 height: number 4 top: number 5 left: number 6 bottom?: number 7 right?: number 8 threshold?: { x: number; y: number } | number 9}
Check if position values are in viewport
1import { inView } from '@reactour/utils' 2 3const isInView = inView({ top: 10, right: 10, bottom: 10, left: 10 })
smoothScroll(elem: Element | null, options: ScrollIntoViewOptions)
Scroll DOM Element into view using native smooth
behavior with a callback when scroll finishes
1const elem = documet.querySelector('.elem') 2 3smoothScroll(elem).then(() => { 4 console.log('Scrolled!') 5})
No vulnerabilities found.
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
10 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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