ANT Components
Forms
Example Form
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.
Ant Design Form
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 Ant Design's grid system:
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 Ant Design Docs.
Components Overview
antd
provides plenty of UI components to enrich your web applications, and we will improve components experience consistently. We also recommend some great Third-Party Libraries additionally.
General3
Layout4
Navigation7
AffixBreadcrumbDropdownMenuPaginationPageHeaderSteps
Data Entry17
AutoCompleteCheckboxCascaderDatePickerFormInputNumberInputMentionsRateRadioSwitchSliderSelectTreeSelectTransferTimePickerUpload
Data Display19
AvatarBadgeCommentCollapseCarouselCardCalendarDescriptionsEmptyImageListPopoverStatisticTreeTooltipTimelineTagTabsTable
Feedback10
AlertDrawerModalMessageNotificationProgressPopconfirmResultSpinSkeleton
Other3
GRID:
Last updated