@rc-component/segmented
React segmented controls used in ant.design
Last updated 5 months ago by afc163 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @rc-component/segmented 
SYNC missed versions from official npm registry.

@rc-component/segmented

NPM version npm download dumi build status Codecov bundle size

React Segmented Control.

Live Demo

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

Install

@rc-component/segmented

Usage

import Segmented from '@rc-component/segmented';
import '@rc-component/segmented/assets/index.css'; // import '@rc-component/segmented/assets/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+

Property Type Default Description
prefixCls string rc-segmented prefixCls of this component
className string '' additional class name of segmented
style React.CSSProperties style properties of segmented
options Array<string | number | SegmentedOption> [] options for choices
value string | number value of segmented
defaultValue string | number defaultValue of segmented
value string | number currently selected value of segmented
onChange (value: string | number) => void defaultValue of segmented
disabled boolean false disabled status of segmented

SegmentedOption

Property Type Default Description
label ReactNode label of segmented option
value string | number value of segmented option
className string '' additional class name of segmented option
disabled boolean false disabled status of segmented option

Development

npm install
npm start

License

@rc-component/segmented is released under the MIT license.

Current Tags

  • 1.3.0                                ...           latest (4 months ago)

7 Versions

  • 1.3.0                                ...           4 months ago
  • 1.2.3                                ...           5 months ago
  • 1.2.2                                ...           7 months ago
  • 1.2.1                                ...           9 months ago
  • 1.2.0                                ...           9 months ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (25)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |