npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

formik-form-components

v0.2.20

Published

A collection of reusable form components built with React, Material UI, Formik, and Tiptap

Downloads

1,189

Readme

Formik Form Components

A comprehensive collection of reusable, accessible, and customizable form components built with React, Material UI, Formik, and Tiptap. This library helps you build production-ready forms faster while maintaining consistency with Material Design.

Form Components Preview


Features

  • 🚀 30+ production-ready form components
  • 🎨 Consistent Material Design styling
  • 🔍 Built-in validation support (Formik + Yup)
  • 📱 Fully responsive and mobile-friendly
  • 🎯 Full TypeScript support
  • 🛠️ Easy theming with MUI
  • 📅 Date & time pickers with calendar icons
  • ✨ Rich text editor powered by Tiptap
  • 📂 File & image uploads with preview
  • 🌍 Internationalization (i18n) ready

Table of Contents


Installation

# npm
npm install formik-form-components

# yarn
yarn add formik-form-components

Getting Started

1. Wrap your app with ThemeProvider (recommended)

import { ThemeProvider, createTheme } from '@mui/material/styles';

const theme = createTheme({});

export default function App() {
  return (
    <ThemeProvider theme={theme}>
      <YourApp />
    </ThemeProvider>
  );
}

2. Basic Form Example

import { Formik, Form } from 'formik';
import * as Yup from 'yup';
import { Button, Box } from '@mui/material';
import {
  AppInputField,
  AppCheckBox,
  AppDatePicker,
  AppRichTextEditor,
  AppRating,
  AppRadioGroup,
  AppMultiSelector,
} from 'formik-form-components';

const validationSchema = Yup.object({
  name: Yup.string().required('Name is required'),
  email: Yup.string().email('Invalid email').required('Email is required'),
  dob: Yup.date().required('Date of birth is required'),
  bio: Yup.string().required('Bio is required'),
  rating: Yup.number().required('Rating is required'),
  gender: Yup.string().required('Gender is required'),
  interests: Yup.array().min(1, 'Select at least one interest'),
  terms: Yup.boolean().oneOf([true], 'You must accept the terms'),
});

const interests = [
  { value: 'sports', label: 'Sports' },
  { value: 'music', label: 'Music' },
  { value: 'reading', label: 'Reading' },
  { value: 'travel', label: 'Travel' },
];

const genderOptions = [
  { value: 'male', label: 'Male' },
  { value: 'female', label: 'Female' },
  { value: 'other', label: 'Other' },
];

export default function ExampleForm() {
  return (
    <Formik
      initialValues={{
        name: '',
        email: '',
        dob: null,
        bio: '',
        rating: 0,
        gender: '',
        interests: [],
        terms: false,
      }}
      validationSchema={validationSchema}
      onSubmit={(values) => console.log(values)}
    >
      {({ isSubmitting }) => (
        <Form>
          <Box sx={{ maxWidth: 600, mx: 'auto', p: 3 }}>
            <AppInputField name="name" label="Full Name" />
            <AppInputField name="email" label="Email" type="email" />
            <AppDatePicker name="dob" label="Date of Birth" />
            <AppRichTextEditor name="bio" label="Bio" />
            <AppRating name="rating" label="Rating" />
            <AppRadioGroup name="gender" label="Gender" options={genderOptions} row />
            <AppMultiSelector name="interests" label="Interests" options={interests} />
            <AppCheckBox
              name="terms"
              option={[{ name: 'terms', label: 'I agree to the terms', value: 'yes' }]}
            />
            <Button type="submit" variant="contained" disabled={isSubmitting}>
              Submit
            </Button>
          </Box>
        </Form>
      )}
    </Formik>
  );
}

Available Components

Form Inputs

  • AppInputField
  • AppTextArea
  • AppCheckBox
  • AppSwitch
  • AppRadioGroup
  • AppRating

Selection Components

  • AppSelect
  • AppSearchableSelect
  • AppMultiSelector
  • AppSearchableMultiSelector
  • AppAutocomplete
  • AppTagsCreator

Date & Time Pickers

  • AppDatePicker
  • AppTimePicker
  • AppDateAndTimePicker
  • AppDateTimePicker

File Handling

  • AppUploadFile
  • AppSimpleUploadFile
  • AppUploadFile
  • AppSimpleUploadFile

Theming

All components fully support Material UI theming.

import { createTheme } from '@mui/material/styles';

export const theme = createTheme({
  palette: {
    primary: { main: '#1976d2' },
    secondary: { main: '#dc004e' },
  },
});

Dark Mode

const darkTheme = createTheme({
  palette: { mode: 'dark' },
});

TypeScript Support

All components are written in TypeScript and fully typed.

type FormValues = {
  name: string;
  email: string;
};

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a Pull Request

License

MIT © tkturners


Support

If you find a bug or have a feature request, please open an issue on GitHub: https://github.com/tkturners/formik-form-components/issues