Skip to content

useFieldRenderer

Overview

A helper composable that computes the derived props and metadata needed to render a field & widget pair, via FieldRenderer.

This composable abstracts out logic around:

  • Slot scoping (e.g. field(x), widget(y), default)
  • Widget and field component resolution
  • Prop merging across field context, object-grid slots, and attribute passthrough
  • Theme resolution for themeOverride values
  • Auto-naming the field input for context or standalone usage

Signature

useFieldRenderer(props, attrs, slots, fieldSetContext)

Parameters

NameTypeRequiredDescription
propsFieldRendererPropsyesThe props from the FieldRenderer component.
attrsobjectyesRaw useAttrs() output (e.g. class, id, etc.).
slotsReadonlyyesRaw useSlots() output, for detecting scoped slot names.
fieldSetContextanynoThe injected field context if inside a fieldset; used to compute full path names.

Returns

any

  • The reactive field renderer instance.

Source

client/lib/use/useFieldRenderer.js:59

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2