Controlled form components designed specifically for Medusa Admin and Medusa UI
Medusa Forms provides a comprehensive set of controlled form components that integrate seamlessly with the Medusa ecosystem, built on top of react-hook-form and @medusajs/ui.
Medusa Forms is a collection of controlled form components extracted and optimized for use with Medusa Admin interfaces. Each component is designed to work perfectly with Medusa's design system while providing excellent developer experience through TypeScript support and comprehensive documentation.
✅ Medusa UI Integration - Built specifically for Medusa Admin design system
✅ Controlled Components - All components work seamlessly with react-hook-form
✅ TypeScript Support - Full type definitions and IntelliSense
✅ Comprehensive Documentation - Interactive Storybook with examples
✅ Performance Optimized - Tree-shaking support and optimized bundle sizes
- ControlledInput - Text input with validation
- ControlledTextArea - Multi-line text input
- ControlledSelect - Dropdown selection with search
- ControlledCheckbox - Checkbox input with proper styling
- ControlledDatePicker - Date selection with calendar
- ControlledCurrencyInput - Currency input with formatting
- FieldWrapper - Consistent field styling and error handling
- Label - Accessible form labels
- ErrorMessage - Standardized error display
npm install @lambdacurry/medusa-forms
# or
yarn add @lambdacurry/medusa-formsimport { useForm, FormProvider } from 'react-hook-form';
import { ControlledInput, ControlledSelect } from '@lambdacurry/medusa-forms';
function MyForm() {
const methods = useForm();
return (
<FormProvider {...methods}>
<form onSubmit={methods.handleSubmit(console.log)}>
<ControlledInput
name="title"
label="Product Title"
placeholder="Enter product title..."
rules={{ required: 'Title is required' }}
/>
<ControlledSelect
name="status"
label="Status"
options={[
{ label: 'Draft', value: 'draft' },
{ label: 'Published', value: 'published' }
]}
/>
</form>
</FormProvider>
);
}These components are designed to work perfectly in Medusa Admin interfaces:
import { RouteConfig } from "@medusajs/admin"
import { FormProvider, useForm } from "react-hook-form"
import { ControlledInput, ControlledCurrencyInput } from "@lambdacurry/medusa-forms"
const ProductForm = () => {
const methods = useForm();
return (
<FormProvider {...methods}>
<form onSubmit={methods.handleSubmit(console.log)}>
<ControlledInput
name="title"
label="Product Title"
/>
<ControlledCurrencyInput
name="price"
label="Price"
symbol="$"
code="USD"
/>
</form>
</FormProvider>
)
}
export const config: RouteConfig = {
link: {
label: "Custom Product Form",
},
}
export default ProductFormCheck out our Form Integration Examples story to see complete working forms with:
- Validation schemas using Zod
- Complex form layouts
- Error handling
- Real-world use cases
- React ^19.0.0
- react-hook-form ^7.51.0
- @medusajs/ui ^4.0.0
- zod ^3.23.8 (for validation examples)
- 📖 Explore Components - Browse the component stories to see all available options
- 🎮 Try Examples - Check out the Form Integration Examples for complete implementations
- 🔧 Customize - All components accept standard HTML props and can be styled as needed
- 🚀 Build - Start building your Medusa Admin forms with confidence!
Ready to build better forms? Start exploring the components in the sidebar! 👈