npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

htec-popover

v1.0.2

Published

A lightweight, highly customizable Portal wrapper around your content. Made with ♥ by HTEC.

Downloads

5

Readme

htec-popover

NPM JavaScript Style Guide

Intro

A lightweight, highly customizable Portal wrapper around your content. At HTEC, we write this component in order to place datepicker and other content on top of body.

Wrapped in Portal, you content will be append to document.body when IsVisible is true. Otherwise it will be removed. You can use it to generate little popups around inputs, divs or any other situation where you want some content to appear and disappear dynamically around a target. It's also smart enough in positioning process whereas you can use Autoplacement property to fine tune where content should be displayed. More of that in API section.

Install

npm install --save htec-popover

Usage

import React from 'react'
import HtecPopover from 'htec-popover'

class Example extends Component {
  render () {
    return (
      <HtecPopover
                autoPlacement={autoPlacement}
                autoPlacementPriority={autoPlacementPriorityValue}
                autoPlacementSize={{ width: autoPlacementWidth, height: autoPlacementHeight }}
                withArrow={withArrow}
                isVisible={isVisible}
                content={getTooltipContent()}
                placement={placementValue}
                offset={offset}
            >
                <div style={{ maxWidth: '300px', margin: '50px auto', textAlign: 'center' }}>
                    <img style={avatarStyle} src={'https://picsum.photos/200'} />
                </div>
      </HtecPopover>
    )
  }
}

API

Popover

|Property|Type|Required|Description| |--------------|----|--------|-----------| |children|JSX.Element|✔️|This is the JSX. target that you'd like the popover content to track. | |isVisible |boolean|✔️|When this boolean is set to true, the popover is visible and tAdded to DOM. Otherwise it will be removed.| |content |JSX or Function |✔️|Here, you'll provide the content that will appear as the popover. Rather than a JSX element like a <div>, you may supply a function that returns a JSX.Element. | |alignment|string ||This property will position your content at 'start, 'end' or center horizontally.| |autoPlacement|boolean||If you choose autoPlacement it will calculate position based on dimensions.| |withArrow|boolean||By default hidden, you can display arrow pointing your preffered content.| |autoPlacementPriority|Array || You can combine between [top, bottom, left, right]. If you pass [top, left] and there is no space in your container, it will try to place content top-left of your target (children) | |contentClassName|String|| You can specify a custom className for the container here.| |offset|Number||You can fine tune content position with offset property.| |onClickOutside|Function||If detects a click event outside of the target and outside of the popover, you may handle this event here. You can use this if you want to close popover on click outside.|

License

MIT © HTEC