StarForge
Components/Form

Select

Select

Custom Select

Basic selection component, without form integration.

Custom Select (react-hook-form)

Selection component integrated with react-hook-form for form management.

How to use with React Hook Form

Install dependencies Make sure you have react-hook-form installed: npm install react-hook-form

Configure the form Import useForm from react-hook-form and configure the selection component with FormField to manage state.

Integrate the component Pass the control and formName to the selection component, as shown in the select-2 example code.

Note

The component with react-hook-form requires proper configuration of the Controller to work correctly. Check the official React Hook Form documentation for more details.

On this page

Built with ❤️ using React, Next.js, TypeScript, and Tailwind CSS