Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
placement.js
Advanced tools
Changelog
[1.0.0-beta.5] - 2021-05-20
bound
option to turn off bounding the overlay position to the scroll container.Readme
A tiny library for positioning overlays. Useful for tooltips, popovers etc.
Why? Positioning UI overlays like popovers and tooltips can be challenging. If you position them with CSS, then at some stage you are likely to run into problems with z-indices, parent overflows, or content going off the edge of the screen. JavaScript to the rescue!
Placement.js addresses a single use-case: positioning an overlay to one side of an anchor element, optimizing the placement depending on the size of the overlay:
Small filesize is a priority for Placement.js so that it can be included in web components. For a more powerful, configurable library, check out Popper.js.
npm install placement.js --save
import placement from 'placement.js';
placement(
anchor: HTMLElement,
overlay: HTMLElement,
options?: Options
);
type Options = {
// The overlay placement relative to the anchor.
// Defaults to 'bottom'.
placement?:
| 'top'
| 'top-start'
| 'top-end'
| 'bottom'
| 'bottom-start'
| 'bottom-end'
| 'right'
| 'right-start'
| 'right-end'
| 'left'
| 'left-start'
| 'left-end',
// Whether or not the overlay can flip to the other side if there's more
// room available. Defaults to true.
flip?: boolean,
// Whether or not the overlay size should be capped to the available space.
// Defaults to true.
cap?: boolean,
// Whether or not the overlay position should be bound to the scroll
// container. Defaults to true.
bound?: boolean,
};
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FAQs
A tiny library for positioning overlays. Useful for tooltips, popovers etc.
The npm package placement.js receives a total of 1,909 weekly downloads. As such, placement.js popularity was classified as popular.
We found that placement.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.