---
title: "number"
image: "https://adonia.pages.dev/og.png"
version: "next"
---

> Documentation Index
> Fetch the complete documentation index at: https://adonia.pages.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# number

<!-- Generated by `pnpm docs:fields` from packages/core/src/schema/fields/number.ts. Edit the TSDoc, not this file. -->

Numeric input bound to a number attribute.

| | |
| --- | --- |
| Builder | `F.number(attribute: string): NumberField` |
| Wire type key | `number` |
| Class chain | `NumberField` → `NumericField` → `Field` |
| Detail projection | `text-entry` |
| Column counterpart | `number` cell, i.e. `C.number(attribute)` |

## Example

```ts
import { F } from '@adonia/core'

F.number('price').label('Price').min(0).max(9999).decimal(2).suffix('EUR')
```

## Props

Beyond the shared [field DSL](/reference/fields#the-shared-field-dsl):

| Prop | Declared on | Behaviour |
| --- | --- | --- |
| `min(value: number): this` | `NumericField` | Lower bound; compiles to Vine `min` (§11.1) and rides the wire for the input. |
| `max(value: number): this` | `NumericField` | Upper bound; compiles to Vine `max` (§11.1). |
| `step(value: number): this` | `NumericField` | Input granularity. A rendering affordance only — see the module note. |
| `decimal(places: number): this` | `NumericField` | Maximum decimal places (§11.1 `decimal(places)`). `decimal(0)` is the integer constraint; omitting it accepts any precision. |

## Validation

Vine base: `vine.number()`.

§11.1 mapping: `vine.number()` + `min`/`max`/`decimal`.

Contributed by `NumericField.vineSchema()` in `packages/core/src/schema/fields/numeric.ts`. The shared modifiers (`required`, `nullable`, `requiredWhen`, `unique`, optionality) are applied on top by `Field.buildValidation`, and a `rules()` override replaces the base entirely — the validator compiler never branches on the field class.

## Declared in

- `packages/core/src/schema/fields/number.ts` — `NumberField`
- `packages/core/src/schema/fields/numeric.ts` — `NumericField`

Source: https://adonia.pages.dev/reference/fields/number/index.mdx
