A controlled form components library for Medusa Admin and Medusa UI applications.
Checkout our Storybook Documentation to see the components in action and get started.
- Controlled Components: All form components are controlled and work seamlessly with react-hook-form
- Medusa UI Integration: Built specifically for Medusa Admin and Medusa UI design system
- TypeScript Support: Full TypeScript support with proper type definitions
- Storybook Documentation: Comprehensive documentation and examples
ControlledInput
- Text input with validationControlledTextArea
- Multi-line text inputControlledSelect
- Dropdown selectionControlledCheckbox
- Checkbox inputControlledDatePicker
- Date selectionControlledCurrencyInput
- Currency input with formatting
Step 1: Install dependencies
yarn install
Step 2: Start Storybook
yarn storybook
When you create a pull request, a preview of the Storybook documentation will be automatically deployed. You can find the link to the preview in the PR comments. This allows you to review changes to the documentation and components before merging.
Preview URLs follow this format:
https://lambda-curry.github.io/medusa-forms/pr-preview/pr-[PR_NUMBER]/
The PR preview system:
- Builds the Storybook documentation for each PR
- Deploys it to a PR-specific directory on the
gh-pages
branch - Adds a comment to the PR with a link to the preview
- Automatically updates the preview when you push new changes to the PR
- Cleans up the preview when the PR is closed
For PR previews to work properly, you need to set up a GitHub environment:
- Go to your repository settings
- Navigate to "Environments"
- Create a new environment named
pr-preview
- Configure environment protection rules as needed:
- You can require reviewers to approve deployment
- You can limit deployment to specific branches
- You can add wait timers before deployment
The main branch will continue to deploy to the github-pages
environment.
If you encounter a 404 error when accessing the PR preview:
- Make sure the PR build has completed successfully by checking the GitHub Actions tab
- Verify that the repository has GitHub Pages enabled and configured to deploy from the
gh-pages
branch - Check that the PR preview comment contains the correct URL
- Ensure the PR has been approved for deployment if environment protection rules are enabled
- Try clearing your browser cache or using an incognito window
The PR preview is deployed to the gh-pages
branch in a directory structure like:
/pr-preview/pr-[PR_NUMBER]/