mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
32 lines
719 B
TypeScript
32 lines
719 B
TypeScript
import { InputNumber, Space, Slider } from 'antd';
|
|
import React from 'react';
|
|
|
|
export interface RadiusPickerProps {
|
|
value?: number;
|
|
onChange?: (value: number | null) => void;
|
|
}
|
|
|
|
export default function RadiusPicker({ value, onChange }: RadiusPickerProps) {
|
|
return (
|
|
<Space size="large">
|
|
<InputNumber
|
|
value={value}
|
|
onChange={onChange}
|
|
style={{ width: 120 }}
|
|
min={0}
|
|
formatter={(val) => `${val}px`}
|
|
parser={(str) => (str ? parseFloat(str) : (str as any))}
|
|
/>
|
|
|
|
<Slider
|
|
tooltip={{ open: false }}
|
|
style={{ width: 128 }}
|
|
min={0}
|
|
value={value}
|
|
max={20}
|
|
onChange={onChange}
|
|
/>
|
|
</Space>
|
|
);
|
|
}
|