shadcn.io is not affiliated with official shadcn/ui
- Group
- Inspect
- Inputs
topicsections?- Access
- Read-only
When to use it
- To build a form: the library's setup, validation and each field type.
- For theming, dark mode or right-to-left.
Inputs
topic"forms" | "react-hook-form" | "tanstack-form" | "formisch" | "styling" | "colors" | "rtl"
forms (which library), a form library, styling (tokens, dark mode), colors, rtl.
- Type
"forms" | "react-hook-form" | "tanstack-form" | "formisch" | "styling" | "colors" | "rtl"
sections?string[]
Only these ## sections, by heading. All when unset.
Example prompts
Name the server, so the agent doesn't answer from memory:
Call and response
Asked “How do I validate this form with React Hook Form?”, the agent sends this call. The response is real, trimmed: long lists show their first items and long strings are cut.
get_guide({ sections: ["Validation"], topic: "react-hook-form" })---
title: React Hook Form
description: "Build forms in React using React Hook Form and Zod."
---
## Validation
### Client-side
React Hook Form validates your form data using the Zod schema. Define a schema and pass it to the `resolver` option of the `useForm` hook.
```tsx title="example-form.tsx"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
import * as z from "zod"
const formSchema = z.object({
title: z.string(),
description: z.string().optional(),
})
export const ExampleForm = () => {
const form = useForm({
resolver: zodResolver(formSchema),
defaultValues: {
title: "",
description: "",
},
```
…Call it by hand
Your MCP client sends this for you. To try the tool without one, post the call yourself; the server answers in server-sent events, the result on the data: line.
What your agent reads
The server's description of get_guide, one of the Inspect tools. Your agent reads it to decide when to call the tool:
A guide as Markdown: forms and their libraries (each field type with its get_demo), styling and dark mode, colors, RTL. sections for only some.Next
FAQ
Where is the form code in the guide?
Each field type (input, select, date picker, file upload, arrays…) has a demo in React Hook Form, TanStack Form and Formisch. The guide names the get_demo call under each; search_demos finds them too.
Which guides can I ask for?
Forms and their three libraries, styling and dark mode, colors and right-to-left. Setting up a project is get_project_setup.