ANT Components
Last updated
Was this helpful?
Last updated
Was this helpful?
Here's an example of building a basic form using our reusable FormInput
& FormButton
components. You can use these to build out different types of forms throughout your application:
Note that we are importing our components from ./components/common
. This is the directory where any of your custom reusable components should live.
Here's is an example of creating a basic form using Ant Design components:
Note that each child component of the form needs to be wrapped in a Form.Item
component for Ant Design's layout to work.
To customize the layout of our form we can create a layout
object and make use of :
You can also specify the grid layouts for each Form.Item
component:
Adding form validation with Ant Design is really simple! We can specify a rules array with an error type and the message we would like to display on that error:
Note that we have to add a name
prop to our input in order for our validation rules to take effect.
For more detail on using the Ant Design Form
component check out the .
GRID:
antd
provides plenty of UI components to enrich your web applications, and we will improve components experience consistently. We also recommend some great additionally.