
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
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
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.

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.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.