mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 04:36:19 +08:00
3b59a03c00
* Add Divider * use Divider in table demos * update demo instruction * upgrade snapshots
21 lines
527 B
TypeScript
21 lines
527 B
TypeScript
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default function Divider({
|
|
prefixCls = 'ant',
|
|
type = 'horizontal',
|
|
className,
|
|
children,
|
|
...restProps,
|
|
}) {
|
|
const classString = classNames(className, `${prefixCls}-divider`, {
|
|
[`${prefixCls}-divider-${type}`]: true,
|
|
[`${prefixCls}-divider-with-text`]: children,
|
|
});
|
|
return (
|
|
<div className={classString} {...restProps}>
|
|
{children && <span className={`${prefixCls}-divider-inner-text`}>{children}</span>}
|
|
</div>
|
|
);
|
|
}
|