
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-rectangle
Advanced tools
#React Rectangle
A very simple React component which provides a box with fixed aspect ratio.
###Install
npm install --save react-rectangle
Don't forget to manually install React^0.14 (peer dependency) if you're using npm@3. ###Use #####ES6
import React from 'react';
import ReactDOM from 'react-dom';
import Rectangle from 'react-rectangle';
ReactDOM.render(
<div style={{ background: '#9e9e9e', width: '100vw', height: '100vh' }}>
<Rectangle aspectRatio={[5, 3]}>
<div style={{ background: '#607d8b', width: '100%', height: '100%' }} />
</Rectangle>
</div>,
document.getElementById('app')
);
#####ES5
var Rectangle = require('react-rectangle');
#####Good old 1998 Script Tag: The component depends on React ^0.14 (a introduction of stateless components), so if you're using it without a build step, React ^0.14 must be present as a global.
<script src="https://npmcdn.com/react@^0.14/dist/react.min.js"></script>
<script src="https://npmcdn.com/react-dom@^0.14/dist/react-dom.min.js"></script>
<script src="https://npmcdn.com/react-rectangle"></script>
###API The components takes a single prop 'aspectRatio'. You can pass a value in different formats:
Also check tests. ###Demo Navigate to the 'demo' folder and execute
npm install
npm run build
npm start
Resize your browser's windows to see the component in action. ###Codepen example http://codepen.io/aush/pen/OMorPv
FAQs
A simple box with fixed aspect ratio
The npm package react-rectangle receives a total of 197 weekly downloads. As such, react-rectangle popularity was classified as not popular.
We found that react-rectangle 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.