# Forms Dify UI form primitives compose Base UI's native form semantics, field accessibility, and Dify styling. They are not a form state-management or schema framework. See the [Base UI forms handbook] for the upstream model. ## Submit boundary Every group of controls that saves or submits together needs a real `
` boundary. Do not wire an `Input` and a click-only `Button` together as an informal form. Use `Form` when the Dify UI boundary should own Base UI's structured `onFormSubmit` values, consolidated errors, `actionsRef`, or `validationMode`. It renders a native ``. A native form remains correct when another form library owns submission and validation; do not nest form owners. Set [`Button`] submit buttons to `type="submit"` explicitly. Keep every other button inside a form at `type="button"`. ## Value and state ownership `Form` owns the submission and validation boundary described above, not each field's draft. Choose controlledness from source-of-truth needs, independently from where a draft is stored. Prefer `defaultValue` when application React code does not need to own the current value. Use `value` and change handlers when application rendering or coordination must own it while editing. Listening to change events, tracking dirty state, and native or primitive validation do not by themselves require controlled state. Application code owns the draft in the narrowest component whose lifetime matches it. A value can be controlled locally without being lifted. An uncontrolled field can participate in a persisted workflow when that workflow captures its value at an explicit persistence boundary. The surrounding surface defines its mount lifecycle; owner placement determines whether draft state lives inside or outside that lifecycle. ## Fields and labels Use `Field` when a control needs a shared name, label, validation, description, or error state. A standalone `Input` may use a native `