New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-positioner

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-positioner

Position an element next to a target.

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
32
-34.69%
Maintainers
1
Weekly downloads
 
Created
Source

react-positioner

A small utility component that positions a container relative to a root.

Example Usage:

import Positioner from "react-positioner";

function Tooltip({ position, content, children, ...rest }) {
    return (
        <Positione {...rest}
            content={
                <span className={`tooltip tooltip--${position}`}>
                    {content}
                </span>
            }
            isShown={visible}
            position={position}>
            {children}
        </Positioner>
    )
}

Props

PropTypeRequiredDefault ValueDescription
position"top" | "left" | "right" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right"YesThe position of the container relative to the target element
targetOffsetnumberNoThe distance from the target element in pixels.
bodyOffsetnumberNoDistance from the edge of the screen.
isShownbooleanYesTell the positioner if the element is shown or not. Great when you want to use with a tooltip or some other, popup container.
childrenReact.NodeYesThe target element of the positioned container
contentReact.NodeYesThe content inside the positioned container

Keywords

positioning

FAQs

Package last updated on 21 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts