/docs/Development/Fields
back to app →

Fields

Fields are how your tool exchanges data with the user. They're declared in artifuncs.json under fields.input, fields.output, and settings. Each field has a type plus optional options.

Common options

These apply to every field type unless noted:

OptionTypeDescription
labelstringHuman-readable label shown above the field. Defaults to the field name.
subtextstringSmall helper text shown under the label.
topRightHintstringSmall muted hint pinned to the top-right of the label row (e.g. "png, jpg, webp"). Good for format/limit reminders.
placeholderstringPlaceholder text inside empty inputs (text-like fields only).
defaultanyInitial value. Type must match the field.
readonlybooleanUser can read but not edit. Used for outputs.
disabledbooleanField is greyed out and inert.
copiablebooleanShows a copy-to-clipboard button. Useful on outputs.
clearablebooleanShows a clear (×) button to wipe the value.

subtext vs topRightHint: subtext is helper text near the field; topRightHint is a compact reminder pinned to the right edge of the label row — ideal for accepted formats or limits.

json
"avatar": {
  "type": "file",
  "label": "Source image",
  "topRightHint": "png, jpg, webp",
  "accept": "image/*"
}
Preview
No file selecteddrag a file here or

text-field

Single-line text.

json
"name": {
  "type": "text-field",
  "label": "Your name",
  "placeholder": "Ada Lovelace",
  "default": ""
}
Preview

password

Single-line text that's masked as you type — same options as text-field. An eye button sits inside the field on the right; hold it down to reveal the value, release to re-mask. Use it for secrets like API keys or tokens so they aren't shoulder-surfed.

json
"apiKey": {
  "type": "password",
  "label": "API key",
  "placeholder": "sk-…"
}
Preview

textarea

Multi-line text. Same options as text-field.

json
"notes": {
  "type": "textarea",
  "label": "Notes",
  "placeholder": "Long-form text…"
}
Preview

number

Numeric input. Accepts integers or floats.

json
"precision": {
  "type": "number",
  "label": "Precision",
  "default": 2
}
Preview

checkbox

Boolean toggle.

json
"verbose": {
  "type": "checkbox",
  "label": "Verbose output",
  "default": false
}
Preview

date

Date picker. Stored as YYYY-MM-DD.

json
"due": {
  "type": "date",
  "label": "Due date",
  "clearable": true
}
Preview

file

File upload (input) or downloadable file reference (output). On input, the user picks a file from disk and your code receives its filename; on output you return a file for the user to download. See Files for how to read and write the bytes from inside process.

OptionDescription
acceptComma-separated MIME types or extensions, e.g. "image/*,.csv".
multipleAccept multiple files.
maxSizeMax bytes per file.
maxFilesMax number of files when multiple is set. Picking past the limit appends only what fits and shows an inline "N files maximum" error — it doesn't reject the whole selection.
json
"upload": {
  "type": "file",
  "label": "Upload CSV",
  "accept": ".csv",
  "maxSize": 5242880
}
Preview
No file selecteddrag a file here or

color

Single color picker. Stored as a hex string.

OptionDescription
showTextFieldShow a hex input next to the swatch.
showSwatchesShow preset color swatches.
json
"brand": {
  "type": "color",
  "label": "Brand color",
  "default": "#FF3C00",
  "showTextField": true
}
Preview

color-palette

A list of hex colors that the user can add to or remove from. Stored as an array of strings.

json
"palette": {
  "type": "color-palette",
  "label": "Palette",
  "default": ["#FF3C00", "#1A0A05"]
}
Preview

list

Array of homogeneous items. Use itemType to declare the type of each item — any field type from this page is allowed.

OptionDescription
itemTypeField type used for each item. Defaults to text-field.
addValueButtonTextCustom label for the "add item" button.
json
"keywords": {
  "type": "list",
  "label": "Keywords",
  "itemType": "text-field",
  "default": []
}
Preview

Outputs

Output fields use the same type values as inputs. They're rendered as read-only by default. Add copiable: true to make them easy to copy:

json
"output": {
  "result": {
    "type": "text-field",
    "label": "Result",
    "copiable": true
  }
}
Preview

Settings

Settings declared under the top-level settings block use the exact same field types and options as inputs. They appear in a separate panel and persist across runs.