Socket
Socket
Sign inDemoInstall

rc-segmented

Package Overview
Dependencies
11
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-segmented

React segmented controls used in ant.design


Version published
Maintainers
3
Weekly downloads
708,242
decreased by-24.44%

Weekly downloads

Readme

Source

rc-segmented

NPM version npm download dumi build status Codecov bundle size

React Segmented Control.

Live Demo

https://react-component.github.io/segmented/

Install

rc-segmented

Usage

import Segmented from 'rc-segmented';
import 'rc-segmented/assets/index.css'; // import 'rc-segmented/asssets/index.less';
import { render } from 'react-dom';

render(
  <Segmented
    options={['Antd', 'Antv', 'Egg.js']}
    onChange={(value) => handleValueChange(value)}
  />,
  mountNode,
);

API

Please note that onChange API changed on v2.0.0+

PropertyTypeDefaultDescription
prefixClsstringrc-segmentedprefixCls of this component
classNamestring''additional class name of segmented
styleReact.CSSPropertiesstyle properties of segmented
optionsArray<string | number | SegmentedOption>[]options for choices
valuestring | numbervalue of segmented
defaultValuestring | numberdefaultValue of segmented
valuestring | numbercurrently selected value of segmented
onChange(value: string | number) => voiddefaultValue of segmented
disabledbooleanfalsedisabled status of segmented

SegmentedOption

PropertyTypeDefaultDescription
labelReactNodelabel of segmented option
valuestring | numbervalue of segmented option
classNamestring''additional class name of segmented option
disabledbooleanfalsedisabled status of segmented option

Development

npm install
npm start

License

rc-segmented is released under the MIT license.

Keywords

FAQs

Last updated on 22 Jan 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc