---
name: ToggleInput
menu: Inputs
---

import { Playground, PropsTable } from 'docz';
import { Formik, Field } from 'formik';

import { ToggleInputPrimitive, ToggleInput } from './';

# ToggleInput

<PropsTable of={ToggleInputPrimitive} />

## Basic usage

<Playground>
  <ToggleInputPrimitive />
</Playground>

## As form field

<Playground>
  <Formik
    render={values => (
      <form>
        <pre>{JSON.stringify(values, null, 2)}</pre>
        <br />
        <Field name="myToggle" component={ToggleInput} defaultToggled />
      </form>
    )}
  />
</Playground>
