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 🙏

© 2026 – Pkg Stats / Ryan Hefner

formik-semantic-ui

v0.10.0

Published

Wrappers for [formik](https://github.com/jaredpalmer/formik) that simplify usage with [semantic-ui-react](https://github.com/Semantic-Org/Semantic-UI-React).

Readme

formik-semantic-ui

Wrappers for formik that simplify usage with semantic-ui-react.

Benefits:

  • No need to manage form state
  • handles onChange for you
  • Normalize all input events to provide a value (Ex: value: true for Checkbox instead of checked
  • Easily handle showing validation messages from client or server
  • REDUCES BOILERPLATE

Install: npm i formik-semantic-ui

Ex:

<Form initialValues={{emailAddress:""}} onSubmit={(values, formikApi) => {
  api.save(values);
  formikApi.setFieldError('emailAdress', 'already in use')
}}>
  <Input label="Email" name="emailAddress" />

  <Button.Submit>Submit</Button.Submit>
  <Button.Reset>Cancel</Button.Reset>
</Form>

Demo:

  • https://turner-industries.github.io/formik-semantic-ui/
  • https://codesandbox.io/s/ywjoykw95x

Components

Input Components

  • Input
  • Dropdown
    • options can be passed to component directly or through inputProps
  • Checkbox
  • TextArea

props:

| Property | Required | Default | Desc | | -------------- | -------- | ----------------------------------- | --------------------------------------------------------------------------------------------------- | | name | required | | formik property key checks touched, errors, and values | | id | optional | field_input_${count} | used to override default id put on component and associated via label | | label | optional | undefined | displays label on <Form.Field> | | inputProps | optional | {} | props to be passed to matching Semantic-UI component. Ex: {type:"password"} on <Input /> | | fieldProps | optional | {} | props passed to <Form.Field /> | | errorComponent | optional | span with class sui-error-message | Use a component that receive a message prop (can be used also as a render prop) | | inputRef | optional | | ref function to get handle to dom element (does not work on DropDown) | | fast | optional | false | whether to use formik's FastField (beneficial for large forms) |

Produce Semantic-UI:

<Form.Field error={checks errors}>
  <label />
  <CONNECTED_FORMIK_COMPONENT /> /* Example <Input /> */
  <span className="sui-error-message">Some error message</span>
</Form.Field>

Form Helpers

<Form />

  • Usage
    • Simple Usage - Components as children
    • Enhanced Usage - "Render Prop" similar to default Formik "Render Prop"
      • render={formikProps => <Form />}
      • function as a child
  • Automatically binds Formik handleSubmit for Semantic UI Form onSubmit
  • Automatically binds Formik isSubmitting for Semantic UI Form loading
  • ignoreLoading - if you wish to disconnect the Forms loading prop from isSubmitting
  • Accepts all <Formik /> props EXCEPT component
  • Accepts the following props from Semantic UI <Form />
    • className
    • inverted
    • size

Ex:

<Form
  {...props}
  onSubmit={handleSubmit}
  loading={!props.ignoreLoading && isSubmitting}
/>

<Form.Children /> - alias for <React.Fragment> to better show intent when using render prop

Buttons

  • Button - <Button {...props} type="button" />
  • Button.Submit - <Button primary {...props} type="submit" />
  • Button.Reset - <Button basic {...props} type="button" onClick={handleReset} />

Creating Custom Components

TODO: Create a better factory

Current:

Schema Driven

Basics

  • Object keys map to component name prop
  • Defaults to Input if type is unknown
  • Unknown types pass their type to Input type={type}
  • You can provide an initial value
  • Very basic width via fieldProps

TODO:

  • Document this better
  • Handle grouping

Usage:

<Form
  onSubmit={this._handleSubmit}
  schema={{
    emailAddress: {
      label: 'Email Address',
      type: 'text',
      value: '[email protected]',
    },
    ssn: {
      label: 'SSN',
      type: 'password',
      fieldProps: {
        width: 8,
      },
    },
    notes: {
      label: 'Notes',
      type: 'textarea',
      inputProps: {
        rows: '6',
      },
    },
    likes: {
      label: 'Favorite Food',
      type: 'dropdown',
      options: [
        {text: 'Pizza', value: 'pizza'},
        {text: 'I am wrong', value: 'im-wrong'},
      ],
    },
    agree: {
      label: 'I Agree',
      type: 'checkbox',
    },
  }}
>
  <Button.Submit>Submit</Button.Submit>
  <Button.Reset>Cancel</Button.Reset>
</Form>