Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
A component that aligns its child relatively to its parent while being aware where it may and may not fit.
npm install react-fit
or yarn add react-fit
.import Fit from 'fit'
.const ElementWithChild = () => (
<Parent>
<Fit>
<PopoverChild />
</Fit>
</Parent>
);
Your project needs to use React 15.5 or later.
A bug in React 16.5.x causes React-Fit to crash on older browsers. While React-Fit will continue to work on React 16.5.x, it's highly recommended that you either upgrade to ^16.6.0 or downgrade to <=16.4.2.
<Fit />
as a child is displayed below its parent, aligned to the left.<Fit />
checks if there's more space for the element on the other side(s) of the axis/axes the collision(s) has been detected on. If so, the element is moved above its parent and/or aligned to the right, depending on collision axis.<Fit />
decreases element's size. If min-width
/min-height
are provided, they will be respected.By default, the element is displayed below its parent, aligned to the left of its parent.
┌────────────┐
│ Parent │
├────────────┴────────────┐
│ │
│ Child │
│ │
└─────────────────────────┘
invertAxis
flag.invertSecondaryAxis
flag.mainAxis="x"
)By providing mainAxis="x"
to <Fit />
, the element is displayed on the right of its parent, aligned to the top of its parent.
┌────────────┬─────────────────────────┐
│ Parent │ │
└────────────┤ Child │
│ │
└─────────────────────────┘
invertAxis
flag.invertSecondaryAxis
flag.The MIT License.
Wojciech Maj kontakt@wojtekmaj.pl http://wojtekmaj.pl |
FAQs
Fit a popover element on the screen.
The npm package react-fit receives a total of 167,872 weekly downloads. As such, react-fit popularity was classified as popular.
We found that react-fit demonstrated a healthy version release cadence and project activity because the last version was released less than 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.