Skip to main content

Form Component Examples

Email Input with Validation

This example uses the react-hook-form validation state in order to display an icon indicating the validity of the email address, as defined by the custom field "pattern" option:

Email input
src/plugins/my-plugin/dashboard/components/email-input.tsx

Multi-Currency Price Input

This example demonstrates a component with its own state (using useState) and more complex internal logic.

Currency input
src/plugins/my-plugin/dashboard/components/price-input.tsx

Tags Input Component

This component brings better UX to a simple comma-separated tags custom field.

Tags input
src/plugins/my-plugin/dashboard/components/tags-input.tsx

Auto-generating Slug Input

This example demonstrates a component that automatically generates a slug from the product name. It uses the react-hook-form watch method to get the value of another field in the form and react to changes in that field.

Slug input
src/plugins/my-plugin/dashboard/components/slug-input.tsx
Note

Input components completely replace the default input for the targeted field. Make sure your component handles all the data types and scenarios that the original input would have handled.

Was this chapter helpful?
Report Issue
Edited Feb 10, 2026·Edit this page