Skip to content

Add FormSwitchInput component with RHF integration and Storybook #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

h3cks
Copy link

@h3cks h3cks commented Jul 17, 2025

This PR introduces a new reusable form component: FormSwitchInput.

  • Integrated with react-hook-form via Controller
  • Based on the existing FormCheckboxInput pattern
  • Accepts an array of selectable options (multi-toggle support)
  • Displays error messages using FormHelperText
  • Customizable via label, testId, keyValue, keyExtractor, and renderOption
  • Fully documented and showcased in Storybook

Files Added

src/components/form/switch/form-switch.tsx
src/components/form/switch/form-switch.stories.tsx

How to test

  1. Run npm run sb
  2. Navigate to Components/Form/SwitchInput
  3. Interact with the switch group to verify toggle and state updates

Screenshots

изображение_2025-07-17_162015208

Copy link

vercel bot commented Jul 17, 2025

@RuslanSuVa is attempting to deploy a commit to the Dev Shchepotin Team on Vercel.

A member of the Team first needs to authorize it.

@h3cks h3cks changed the title feat: add FormSwitchInput component with RHF integration and Storybook Add FormSwitchInput component with RHF integration and Storybook Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant