The component props.
The rendered select element.
This component integrates with useInputValidation to handle real-time validation
and error reporting. It shares styling with the Input component for consistency.
import { enum_ } from 'valibot';
import { Select, Option } from './select';
enum Role { Admin = 'admin', User = 'user' }
const roleSchema = enum_(Role);
function RoleSelect() {
return (
<Select name="role" validate={roleSchema}>
<Option value="admin">Admin</Option>
<Option value="user">User</Option>
</Select>
);
}
A styled select component with built-in validation support.