> ## Documentation Index
> Fetch the complete documentation index at: https://flex-fields.bjanczak.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Examples target Filament 5. Verify optional dependencies before configuring integrations.
> Upload transfer completion, permanent storage and record acceptance are separate milestones. Native and Spatie image conversions retain the original.

# Extension recipes

> Choose a practical architecture for composite fields, display families and optional editors.

Choose the smallest set of surfaces and behaviors that matches your extension.
These recipes combine the documented APIs; they do not introduce another build
system or configuration format.

> [!TIP]
>
> **Watch this in the workshop:** [21:35 — try the campaign brief builder](https://www.youtube.com/watch?v=m4V_R7YxTP4\&t=1295s) · [36:12 — add table and infolist presentations](https://www.youtube.com/watch?v=m4V_R7YxTP4\&t=2172s) · [46:57 — add a custom settings dialog](https://www.youtube.com/watch?v=m4V_R7YxTP4\&t=2817s).

> **Composite field with an existing FLEX input**
>
> Generate a family, replace the default child schema with actual FLEX fields, and
> store an object in a JSON attribute. Use child validation and reject unknown keys
> in your parent value contract. Share parent display CSS across the column and entry.
> Follow [quickstart](https://flex-fields.bjanczak.com/docs/extensions/quickstart.md), then
> [full child PHP configuration](https://flex-fields.bjanczak.com/docs/extensions/child-php-api.md).

> **Select with a relationship inside a parent**
>
> Declare a Select child slot, render it through `ChildRenderer`, then configure the
> returned Select with its real `relationship()` and query callbacks in trusted PHP.
> Preserve the child instance and native model context. Use typed JSON options for
> portable choices such as size or limits; do not serialize relation closures.
> Follow [Select composition](https://flex-fields.bjanczak.com/docs/extensions/child-select.md) and
> [custom child factories](https://flex-fields.bjanczak.com/docs/extensions/custom-child-factories.md).

> **Field plus a lightweight table column and infolist entry**
>
> Declare a semantic family with three independent identities. Put common CSS under
> a primitive display owner and reference it through `stylesFrom`. Add JS only to
> the field. Call the same escaped value formatter from the two display templates.
> Follow [family contracts](https://flex-fields.bjanczak.com/docs/extensions/packages-and-families.md) and
> [columns and entries](https://flex-fields.bjanczak.com/docs/extensions/columns-and-entries.md).

> **Optional editor loaded only when used**
>
> Declare an optional capability and a lazy module. Enable it for the rendered
> instance that actually supports editing. Place controls inside a prepared custom
> surface and own all listeners and workers with that surface or factory.
> Follow [asset ownership](https://flex-fields.bjanczak.com/docs/extensions/asset-ownership.md),
> [build](https://flex-fields.bjanczak.com/docs/extensions/build.md) and [custom surfaces](https://flex-fields.bjanczak.com/docs/extensions/surfaces.md).

> **Extension selected through saved schemas**
>
> Add a `FamilySchemaContract` with typed configuration and a trusted adapter.
> Use the family builders to render each supported surface. Validate writes through
> an explicit save policy and persist versioned snapshots for future migrations.
> Follow [schema adapters](https://flex-fields.bjanczak.com/docs/extensions/schema-adapter.md),
> [submission](https://flex-fields.bjanczak.com/docs/extensions/submission.md) and [migrations](https://flex-fields.bjanczak.com/docs/extensions/migrations.md).

> **Shared use in multiple panels or tenants**
>
> Register structural metadata once at provider boot. Supply request-local owner,
> user, tenant, locale and defaults through `FamilyRenderContext`. Give independent
> rendered instances distinct identities. Keep configuration values and record state
> outside process-lived registration metadata. See
> [schema context reference](https://flex-fields.bjanczak.com/docs/extensions/schema-reference.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.