Reference Field Reference
fields.assets()
Multiple asset references, optionally restricted by kind.
Multiple asset references. Maps to editor { name: 'str-assets', type: 'assets' }. Output is Asset[] — the canonical asset shape from @strifeapp/types.
Example
fields.assets({
label: 'Gallery',
accept: ['image/*', 'video/*'],
size: 12,
})Options
| Option | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Label shown to editors in Strife Studio. |
description | string | No | Not shown in Studio's editor panel. |
searchable | boolean | No | Stored on the template; nothing uses it today. |
filterable | boolean | No | Stored on the template; nothing uses it today. |
protected | boolean | No | Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel. |
propertyName | string | No | Override the stored property name. |
accept | ('image/*' | 'video/*' | 'file/*')[] | No | Restrict pickable assets to these kinds. Omit to allow all. |
size | number | null | No | Maximum number of assets. |
Note:
Only the wildcard form ('image/*', 'video/*', 'file/*') is accepted today — that's a deliberate placeholder for full MIME-type matching ('image/jpeg', 'document/pdf', etc.), which the wire format doesn't support yet. At compile time each wildcard is translated to the numeric code the asset picker actually checks (image/* → 1, video/* → 2, file/* → 3) — there is no string-based filtering on the wire, only these three categories.
No localizable option.
Output type
Asset[].
See also
- Assets — the same editor, documented from the Strife Studio UI side.