Skip to Content
SchemaData Types and Input Types

Data Types and Input Types

dataType and inputType are related but different:

  • dataType: storage/data semantics.
  • inputType: form UI component used in Studio.

Supported dataType Values

  • string
  • int
  • float
  • bigint
  • boolean
  • id
  • date
  • datetime
  • time
  • duration
  • point
  • cartesianpoint
  • asset

Built-in inputType Values

  • text
  • textarea
  • number
  • select
  • switch
  • datetime
  • relationship
  • asset
  • editor

inputType is one of the built-in values above. The Studio UI is not extended from the config, so there are no custom input types: an unknown inputType string renders the built-in text field (with a console warning), and an unknown previewType string falls back to the built-in text preview.

Built-in previewType Values

previewType chooses how a value renders in lists. When omitted, it follows the inputType.

  • text, textarea, number, date, datetime, editor, select, relationship, boolean, switch
  • rating: filled stars for a numeric attribute. options.max sets the star count (default 5); values are rounded and clamped, and empty values render nothing.
TypeScript
{
  name: 'rating',
  label: 'Rating',
  scope: 'global',
  dataType: 'int',
  inputType: 'number',
  previewType: 'rating',
  options: { min: 1, max: 5 },
  validation: (z) => z.number().int().min(1).max(5),
}

Input Type Reference

text

  • Typical dataType: string, id
  • Options: comment, size, placeholder

textarea

  • Typical dataType: string
  • Options: comment, size, placeholder

number

  • Typical dataType: int, float, bigint
  • Options: comment, size, placeholder, min, max

select

  • Typical dataType: string, sometimes int
  • Options:
    • list: { label; value }[] | { groupLabel; items }[]
    • comment, size, placeholder

switch

  • Typical dataType: boolean
  • Options: comment, size, placeholder

datetime

  • Typical dataType: date, datetime, time
  • Options: comment, size, placeholder, format

relationship

  • Typical dataType: usually string with relationship metadata
  • Requires relationship: { entity, mode, field }
  • Supports single and multiple connections
  • Supports ordered asset galleries with relationship: { mode: 'multiple', entity: '_asset', field: 'originalFilename' }

asset

  • Typical dataType: asset
  • Options: comment, size, placeholder, accept
  • Supports upload workflows and file/image metadata

editor

  • Typical dataType: string
  • Stores rich content as JSON string

Common Patterns

TypeScript
// Boolean switch
{
  name: 'isActive',
  label: 'Active',
  scope: 'global',
  dataType: 'boolean',
  inputType: 'switch',
  defaultValue: false,
}
 
// Numeric amount
{
  name: 'amount',
  label: 'Amount',
  scope: 'global',
  dataType: 'float',
  inputType: 'number',
  options: { min: 0, max: 1000000 },
  defaultValue: 0,
}

Important Notes

  • Unknown inputType values render the text field in the Studio form. Unknown previewType values fall back to the text preview in lists.
  • select can cast values based on dataType (for example integer values).
  • For scoped entities, fields can inherit defaults via the “Use default value” behavior.
Last updated on