-
Notifications
You must be signed in to change notification settings - Fork 67
PageForm
James Talton edited this page Jan 4, 2023
·
24 revisions
The Ansible UI Framework PageForm uses react-hook-form.
The standard layout for creating a page with a form:
<Page>
<PageLayout>
<PageHeader />
<PageForm>
<PageFormInput />
<PageFormInput />
<PageFormInput />
</PageForm>
</PageLayout>
</Page>
<PageFormTextInput
name="name"
label="Name"
placeholder="Enter name"
isRequired
minLength={10}
maxLength={100}
pattern={/^startsWith/}
validate={(value:string) => "some error string"}
/>
Prop | Type | Description |
---|---|---|
isRequired | boolean | Boolean which, if true, indicates that the input must have a value before the form can be submitted. You can assign a string to return an error message in the errors object. |
maxLength | number | The maximum length of the value to accept for this input. |
minLength | number | The minimum length of the value to accept for this input. |
max | number | The minimum value to accept for this input. |
min | number | The minimum value to accept for this input. |
pattern | RegExp | The regex pattern for the input. |
validate | Function | Object | You can pass a callback function as the argument to validate, or you can pass an object of callback functions to validate all of them. This function will be executed on its own without depending on other validation rules included in the required attribute. |
PageFramework
PageHeader
PageLayout
PageDashboard
PageDashboardCarousel
PageDetails
PageForm
PageTable
PageTabs
PageToolbar
BulkActionDialog
BulkConfirmationDialog
EmptyState
PageCarousel
ReorderItems
useBreakPoint
useFrameworkTranslations
useInMemoryView
useIsMounted
useOpen
usePageNavigate
useSearchParams
useSelectDialog
useTableItems
useView
useWindowLocation
useDeleteRequest
useGet
useGetAllPagesAWX
useGetItem
useGetRequest
useOptions
usePatchRequest
usePostRequest