mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
23 lines
481 B
TypeScript
23 lines
481 B
TypeScript
|
import React, { useState } from 'react';
|
||
|
import { Checkbox, InputNumber, Space } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [keyboard, setKeyboard] = useState(true);
|
||
|
|
||
|
return (
|
||
|
<Space>
|
||
|
<InputNumber min={1} max={10} keyboard={keyboard} defaultValue={3} />
|
||
|
<Checkbox
|
||
|
onChange={() => {
|
||
|
setKeyboard(!keyboard);
|
||
|
}}
|
||
|
checked={keyboard}
|
||
|
>
|
||
|
Toggle keyboard
|
||
|
</Checkbox>
|
||
|
</Space>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|