
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
react-segmented-control
Advanced tools
Simple React component for a segmented control.
npm install react-segmented-control --save
or
bower install react-segmented-control --save
Controlled usage:
var SegmentedControl = require('react-segmented-control');
var App = React.createClass({
getInitialState() {
return {
color: 'red'
};
},
render() {
return (
<div>
<SegmentedControl
onChange={this.colorUpdated}
value={this.state.color}
name="color">
<span value="red">Red</span>
<span value="blue">Blue</span>
</SegmentedControl>
<div className='background' style={{background: this.state.color}} />
</div>
);
},
colorUpdated(value) {
this.setState({color: value});
}
});
All props are optional except name.
Class of the Component (in addition of segmented-control).
Function called when the control is changed (value will be passed as an argument).
Use defaultValue to specify an initial value. Use value to use this component as a controlled component.
Name of the input.
Look at react-segmented-control.css for an idea on how to style this component.
MIT Licensed
FAQs
Simple react.js component for a segmented control
The npm package react-segmented-control receives a total of 13 weekly downloads. As such, react-segmented-control popularity was classified as not popular.
We found that react-segmented-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.