- Text and Number inputs
- Date input and Textarea
- Dropdowns, Checkboxes, and Radio buttons
- Sliders and Switches
Generating Forms
There are two primary methods to instruct the C1 API to generate a form: automatically from a tool schema (recommended), or manually via a system prompt.Automatic Generation from a Tool Schema (Recommended)
The most robust way to generate a form is to provide the LLM with the JSON schema of a tool you want it to use. See Integrating data for more details. C1 automatically renders the required input fields based on the tool’s parameters. For example, to create a Jira copilot, you can provide the schema for acreate_jira_issue
tool.
title
, priority
, and description
. It will even pre-fill the title
field, since that value was already provided in the user’s prompt.
Manual Generation via System Prompt
For simpler cases or more direct control, you can instruct the LLM to generate a specific form using a system prompt.How Forms Work on the Frontend
Once a form is rendered, the C1 SDK handles most of the complexity for you.Automatic State Management
As a user types into a C1-generated form, the state of each input field is managed automatically within the component. You do not need to writeuseState
or onChange
handlers to track these values.
This internal state is the same state that is captured and persisted via the updateMessage
callback, as described in the Managing State guide.
Handling Form Submissions
When a user clicks the submit button on a C1-generated form, it triggers theonAction
callback. The action
object passed to your handler will contain all the data from the form.
Here is how you would handle a form submission on the frontend:
action.llmFriendlyMessage
to C1 Api as user prompt from you backend.