ant-design/components/switch/index.jsx
Bruce Mitchener eaae43abdd More ES2015 classes.
This covers Carousel, InputNumber, Select, Slider, Switch, TreeSelect
and Tree.
2016-03-21 08:26:05 +07:00

19 lines
456 B
JavaScript

import RcSwitch from 'rc-switch';
import React from 'react';
import classNames from 'classnames';
export default class Switch extends React.Component {
render() {
const { prefixCls, size, className } = this.props;
const cls = classNames({
[className]: !!className,
[`${prefixCls}-small`]: size === 'small',
});
return <RcSwitch className={cls} {...this.props} />;
}
}
Switch.defaultProps = {
prefixCls: 'ant-switch',
};