Tinacms Developer Docs
Fields

String Field

A text input for short-form content like titles and descriptions

A text input for short-form content. For formatted text with bold, italic, links, etc., use the rich-text field instead.

Usage

{
  type: 'string',
  name: 'title',
  label: 'Title',
}

Options

PropertyTypeDescription
type'string'Required.
namestringField identifier.
labelstringDisplay label in the editor.
listbooleanStore multiple values as an array.
optionsstring[]Restrict to predefined values (renders as dropdown).
ui.component'text' | 'textarea' | 'select'Input component to use.

Type Signature

interface StringField {
  type: 'string'
  name: string
  label?: string
  list?: boolean
  options?: string[] | { value: string; label: string }[]
  ui?: {
    component?: 'text' | 'textarea' | 'select' | React.FC
  }
}

Examples

List of Strings

{
  type: 'string',
  name: 'tags',
  label: 'Tags',
  list: true,
}

Textarea

{
  type: 'string',
  name: 'description',
  label: 'Description',
  ui: { component: 'textarea' },
}
{
  type: 'string',
  name: 'status',
  label: 'Status',
  options: ['draft', 'published', 'archived'],
}

On this page