en un clic
repo-website-api-create
// Create new API documentation routes for the Formisch website. Use when adding documentation for new exported functions, types, components, or methods that don't yet have website documentation.
// Create new API documentation routes for the Formisch website. Use when adding documentation for new exported functions, types, components, or methods that don't yet have website documentation.
| name | repo-website-api-create |
| description | Create new API documentation routes for the Formisch website. Use when adding documentation for new exported functions, types, components, or methods that don't yet have website documentation. |
| metadata | {"author":"formisch","version":"1.0"} |
This skill provides instructions for adding new API reference routes to the Formisch website. Consistency and uniformity across all API documentation is critical.
Key Principle: Source code is the single source of truth. All documentation is derived directly from the source code.
Each API function or type needs its own folder containing:
index.mdx - The main documentation file with MDX contentproperties.ts - TypeScript definitions that map to the Property componentBefore creating documentation:
This is the most critical step. Read the entire source file and extract:
extends clausesCreate folder in the appropriate category:
/website/src/routes/(docs)/{framework}/api/(category)/{ApiName}/
├── index.mdx
└── properties.ts
Categories by framework:
core/api/(types) - Core/shared type definitionsmethods/api/ - Global methods (focus, validate, reset, etc.)solid/api/(primitives) - SolidJS primitives (createForm, useField)solid/api/(components) - SolidJS components (Field, Form)solid/api/(types) - SolidJS-specific typesqwik/api/(hooks) - Qwik hooks (useForm$, useField)preact/api/(hooks) - Preact hookssvelte/api/(runes) - Svelte 5 runesvue/api/(composables) - Vue composablesSee references/property-component.md for the Property component specification and type mapping patterns.
import type { PropertyProps } from '~/components';
export const properties: Record<string, PropertyProps> = {
// 1. GENERICS - with modifier: 'extends'
TSchema: {
modifier: 'extends',
type: {
type: 'custom',
name: 'FormSchema',
href: '/core/api/FormSchema/',
},
},
// 2. PARAMETERS - matching function signature
config: {
type: {
type: 'custom',
name: 'FormConfig',
href: '../FormConfig/',
generics: [{ type: 'custom', name: 'TSchema' }],
},
},
// 3. RETURN TYPE
Store: {
type: {
type: 'custom',
name: 'FormStore',
href: '../FormStore/',
generics: [{ type: 'custom', name: 'TSchema' }],
},
},
};
See references/mdx-patterns.md for detailed MDX structure and patterns.
---
title: createForm
description: Creates a reactive form store from a form configuration.
source: /frameworks/solid/src/primitives/createForm/createForm.ts
contributors:
- fabian-hiller
---
import { ApiList, Property } from '~/components';
import { properties } from './properties';
# createForm
Creates a reactive form store from a form configuration.
\`\`\`ts
const form = createForm<TSchema>(config);
\`\`\`
## Generics
- `TSchema` <Property {...properties.TSchema} />
## Parameters
- `config` <Property {...properties.config} />
### Explanation
With `createForm` you can create a reactive form store...
## Returns
- `form` <Property {...properties.Store} />
## Examples
The following examples show how `createForm` can be used.
### Basic form
\`\`\`ts
import { createForm } from '@formisch/solid';
import \* as v from 'valibot';
const LoginSchema = v.object({
email: v.pipe(v.string(), v.email()),
password: v.pipe(v.string(), v.minLength(8)),
});
const loginForm = createForm({ schema: LoginSchema });
\`\`\`
## Related
### Primitives
<ApiList
items={[
{ text: 'useField', href: '../useField/' },
{ text: 'useFieldArray', href: '../useFieldArray/' },
]}
/>
### Components
<ApiList
items={[
{ text: 'Form', href: '../Form/' },
{ text: 'Field', href: '../Field/' },
]}
/>
Add to the appropriate menu.md file in alphabetical order:
## Primitives
- [createForm](/solid/api/createForm/)
- [useField](/solid/api/useField/)
Parentheses folders don't appear in URLs:
/solid/api/createForm/ (not /solid/api/(primitives)/createForm/)../FormStore//core/api/FormSchema/https://valibot.dev/api/InferInput/| Framework | Category Term | Example API |
|---|---|---|
| Solid | Primitives | createForm, useField |
| Qwik | Hooks | useForm$, useField |
| Preact | Hooks | useForm, useField |
| Vue | Composables | useForm, useField |
| Svelte | Runes | createForm, useField |
For detailed patterns and examples, see:
Before submitting:
menu.md updated in alphabetical orderDocument Formisch source code with JSDoc and inline comments. Use when writing or updating documentation comments in packages/core, packages/methods, or frameworks/* source files.
Review PRs and source code changes in Formisch packages/ and frameworks/. Use when reviewing pull requests, validating implementation patterns, or checking code quality before merging.
Review and verify API documentation routes on the Formisch website. Use when checking documentation accuracy, completeness, and consistency with source code.
Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source.
Write unit and type tests for Formisch framework packages (frameworks/preact, frameworks/solid, frameworks/svelte, frameworks/vue, frameworks/react). Use when adding tests for hooks/composables/runes (useForm/createForm, useField, useFieldArray) or components (Form, Field, FieldArray) in any framework wrapper.
Write unit tests for Formisch packages (packages/core and packages/methods) with proper TypeScript types. Use when creating new tests, fixing type errors in tests, or adding test coverage for core/methods functions.