You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Always use `Form<T>` from `@furystack/shades-common-components`
216
+
217
+
Never use raw `<form>` HTML elements. The `Form<T>` component provides type-safe form data collection, two-tier validation (input + form level), and integration with all form field components (`Input`, `Select`, `Checkbox`, etc.).
218
+
219
+
### Pattern: Typed Form Payload
220
+
221
+
Every form needs:
222
+
223
+
1. A **payload type** describing the form data shape
224
+
2. A **type-guard `validate` function** that narrows `unknown` to the payload type
225
+
3. A `Form<T>` component with `validate` and `onSubmit` props
226
+
227
+
```typescript
228
+
import { Form, Input, Button } from '@furystack/shades-common-components';
229
+
230
+
type CreateStackPayload = {
231
+
name: string;
232
+
displayName: string;
233
+
description: string;
234
+
mainDirectory: string;
235
+
};
236
+
237
+
const isCreateStackPayload = (data: unknown): data is CreateStackPayload => {
0 commit comments