Tina Docs
Introduction
Core Concepts
Querying Content
Editing
Customizing Tina
Going To Production
Drafts
Guides
Further Reference
Table of Contents

number Type

type NumberField = {
label: string
name: string
type: 'number'
list?: boolean
// See https://tina.io/docs/extending-tina/overview/ for customizing the UI
ui?: {
label?: string
description?: string
component?: FC<any> | string | null
parse?: (value: number | number[], name: string, field: F) => any
format?: (value: number | number[], name: string, field: F) => any
validate?(
// number or number[] depends on list true or false
value: number | number[],
allValues: any,
meta: any,
field: UIField<F, Shape>
): string | undefined | void
}
}

Examples

Tina will generate the appropriate component depending on the configuration provided.

Simple

{
type: 'number',
name: 'count',
label: 'Count',
description:'An example number field.'
}

Last Edited: September 12, 2024