mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-26 01:42:30 +08:00
34 lines
754 B
TypeScript
34 lines
754 B
TypeScript
import React from 'react';
|
|
import { InputNumber, Slider, Space } from 'antd';
|
|
|
|
export interface RadiusPickerProps {
|
|
id?: string;
|
|
value?: number;
|
|
onChange?: (value: number | null) => void;
|
|
}
|
|
|
|
export default function RadiusPicker({ value, onChange, id }: 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))}
|
|
id={id}
|
|
/>
|
|
|
|
<Slider
|
|
tooltip={{ open: false }}
|
|
style={{ width: 128 }}
|
|
min={0}
|
|
value={value}
|
|
max={20}
|
|
onChange={onChange}
|
|
/>
|
|
</Space>
|
|
);
|
|
}
|