>;
```
### Component Props (via defineRegistry)
```tsx
interface ComponentContext {
props: P; // Typed props from catalog
children?: React.ReactNode; // Rendered children (for slot components)
emit?: (event: string) => void; // Emit a named event
loading?: boolean;
}
```
## Hooks
### useUIStream
```typescript
const {
spec, // Spec | null - current UI state
isStreaming, // boolean - true while streaming
error, // Error | null
send, // (prompt: string, context?: Record) => Promise
clear, // () => void - reset spec and error
} = useUIStream({
api: string, // API endpoint URL
onComplete?: (spec: Spec) => void, // Called when streaming completes
onError?: (error: Error) => void, // Called when an error occurs
});
```
### useStateStore
```typescript
const {
data, // Record
setState, // (data: object) => void
getValue, // (path: string) => unknown
setValue, // (path: string, value: unknown) => void
} = useStateStore();
```
### useStateValue
```typescript
const value = useStateValue(path: string);
```
### useStateBinding
```typescript
const [value, setValue] = useStateBinding(path: string);
```
### useActions
```typescript
const { dispatch } = useActions();
// dispatch(actionName: string, params: object)
```
### useAction
```typescript
const submitForm = useAction('submit_form');
// submitForm(params: object)
```
### useIsVisible
```typescript
const isVisible = useIsVisible(condition?: VisibilityCondition);
```
### useFieldValidation
```typescript
const {
value, // unknown
setValue, // (value: unknown) => void
errors, // string[]
validate, // () => Promise
isValid, // boolean
} = useFieldValidation(path: string, checks: ValidationCheck[]);
```