> For the complete documentation index, see [llms.txt](https://docs.tutim.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tutim.io/react-sdk/tutim-form.md).

# TutimWizard

## Overview

`TutimWizard` is a component that provides a simple interface for defining the fields and multi-step form behavior, while handling the infrastructure and user interface for you

## Installation

To use `TutimWizard`, you will need to install the `@tutim/fields` and `@tutim/headless` libraries in your react project. You can do this using npm or yarn:

```bash
npm install @tutim/fields @tutim/headless @tutim/types
```

```bash
yarn add @tutim/fields @tutim/headless @tutim/types
```

## Basic example

To create a multi-step form using `TutimWizard`, you will need to define the fields that you want to include in your wizard. You can do this by creating a `config` object with a `fields` property, which is an array of field objects. Each field object should have a `key`, `label`, and `type` property.

Here is an example of how to use `TutimWizard` to create a simple form with two text input fields:

[Open with CodeSandbox >>>](https://codesandbox.io/s/tutim-examples-5ny73h)

```jsx
import React from 'react';
import { FormProvider } from '@tutim/headless';
import { TutimWizard, defaultFields } from '@tutim/fields';

const config = {
  fields: [
    { key: 'firstName', label: 'First Name', type: 'text' },
    { key: 'lastName', label: 'Last Name', type: 'text' },
  ],
};


const App = () => {
  return (
    <div className="App">
      <FormProvider fieldComponents={defaultFields}>
        <TutimWizard onSubmit={console.log} config={config} />;
      </FormProvider>
    </div>
  );
};

export default App;
```

This will render a form with two text input fields, labeled "First Name" and "Last Name". When the form is submitted, the data entered into the fields will be logged to the console.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tutim.io/react-sdk/tutim-form.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
