1.0.2 • Published 3 years ago
rc-antd-addons v1.0.2
rc-antd-addons
Made with create-react-library, This package is to simplify usage of form elements available in antd.
Install
npm install --save rc-antd-addons
Usage
import React from "react";
import { InputBox, FormBox } from "rc-antd-addons";
const App = () => {
const handleSubmit = (data: any): void => {
console.log(data);
};
return (
<FormBox onFinish={handleSubmit}>
<InputBox.Text label="Name" name="name" placeholder="Name" size="large" />
<InputBox.Password
label="Password"
name="password"
placeholder="Password"
size="large"
/>
<InputBox.DatePicker label="DatePicker" name="date" size="large" />
<InputBox.DateRangePicker
label="Date Range Picker"
name="date_range"
size="large"
/>
<InputBox.Select
label="Selectbox"
name="select"
placeholder="Select Option"
options={{
list: [
{ id: 1, name: "option 1" },
{ id: 2, name: "option 2" },
],
}}
/>
<InputBox.Radio
label="Radio Button"
name="radio"
type="button"
options={{
list: [
{ id: 1, name: "option 1" },
{ id: 2, name: "option 2" },
],
}}
/>
<InputBox.Number
name="number_field"
label="Number Field"
placeholder="Number"
/>
<Button htmlType="submit" type="primary" size="large">
Submit
</Button>
</FormBox>
);
};
export default App;
License
MIT © patel-prince