---
alias: "fc.settingForm"
aliases:
  - fc.settingForm
category: content
module: Core
---
# fc.settingForm

Form for creating and updating Fluent Commerce settings. Renders fields based on a schema definition and the setting's current value. Supports create (override default) and update operations.

## When to Use
- Settings editor pages
- Retailer/account/location configuration forms
- Any page where a user needs to view and edit a Fluent setting value

## Key Props
| Prop | Type | Required | What it controls |
|------|------|----------|------------------|
| `setting` | string | **Yes** | Setting name to load and edit (e.g., `"orderWorkflowConfig"`) |
| `schema` | string | **Yes** | Schema setting name that defines the form field structure |
| `context` | string | **Yes** | Setting context: `"ACCOUNT"`, `"RETAILER"`, or `"AGENT"` (location) |
| `contextId` | number / string | Recommended | Context ID (retailer ID, account ID, or location ID). Supports template strings: `"{{activeRetailer.id}}"`, `"{{params.id}}"` |
| `title` | string | No | Card header title (inherited from Card) |
| `width` | CardWidth | No | Card width (inherited from Card) |
| `highlight` | string | No | Card border highlight color (inherited from Card) |

## Data Binding
`contextId` supports template strings with access to `{{activeContext.id}}`, `{{activeLocation.id}}`, `{{activeRetailer.id}}`, `{{activeUser}}`, and `{{params.*}}` (route params).

## Descendants
No.

## Gotchas
- **The prop is `setting`, NOT `settingName`** -- the source code uses `setting` as the prop name for the setting key
- `schema` is also a setting name (not an inline object) -- it references a separate Fluent setting that contains the JSON schema definition
- The component validates that `context` is one of `ACCOUNT`, `RETAILER`, or `AGENT` -- invalid values cause the form to not render
- `contextId` is required to be a valid integer -- if the template string evaluates to NaN, the form will not render and submit will be blocked
- When the setting does not yet exist at the specified context level, the form shows an "Override Default" button (create mode). When it exists, it shows "Submit" (update mode)
- Schema and setting value types must match (JSON/INTEGER/BOOLEAN/STRING) -- a mismatch logs an error and the form does not render
- The form uses the `useSchema` hook to dynamically generate form fields from the schema setting's value

## Validation Rules
P18 (needs setting name or reference)

## Manifest Example
```json
{
  "component": "fc.settingForm",
  "props": {
    "setting": "orderWorkflowConfig",
    "schema": "orderWorkflowConfig_schema",
    "context": "RETAILER",
    "contextId": "{{activeRetailer.id}}",
    "title": "Order Workflow Configuration"
  }
}
```

## AI Parse Notes
- **Primary intent:** Declarative Mystique component definition for manifests.
- **Selection signals:** Match by `alias`, category, and required `Key Props`.
- **Assembly hints:** Combine with compatible parent/child components listed in `Composition Patterns`.
- **Safety checks:** Validate required props and data bindings before manifest generation.
