
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
react-controlfacades
Advanced tools
This project gives you a way to easily customize control "facades"—what's
presented to a user—while keeping the native browser functionality. For example,
you can provide a custom component for displaying a <select>
, but interacting
with it will trigger the browser's dropdown, wheel (iOS), or other
browser-appropriate view. It works by overlaying the original control with an
opacity of 0 on top of your custom component.
In effect, this package gives you controllers and allows you to provide your own "dumb view" or "controlled" components for displaying state.
This is based on previous work on the jquery.icbiacontrol plugin.
import React from 'react';
import {checkbox} from 'react-controlfacades';
@checkbox()
class MyCheckbox extends React.Component {
render() {
const style = {
display: 'inline-block',
width: '30px',
height: '30px',
border: '2px solid black',
backgroundColor: this.props.value ? 'black': 'white',
};
return (
<div style={style}></div>
);
}
}
The facade will receive the following props:
name | description |
---|---|
value | The value of the control |
label | For select boxes, the option string that corresponds to the selected value. |
checked | For check boxes, a boolean the corresponds to whether or not the box has been checked |
focus | Whether or not the control has focus |
The wrapped facade will also accept some props for managing behavior:
name | description |
---|---|
autoFocus | Whether or not to immediately focus the control on mount. |
onFocus | A callback for when the control receives focus. Receives the event as its only argument. |
onBlur | A callback for when the control loses focus. Receives the event as its only argument. |
FAQs
Style form controls but use their default behavior
The npm package react-controlfacades receives a total of 0 weekly downloads. As such, react-controlfacades popularity was classified as not popular.
We found that react-controlfacades demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.