Skip to content

The open alternative to Salesforce, designed for AI.

12.6 KB
Raw Blame
{/*
 * _____                    _
 *|_   _|_      _____ _ __ | |_ _   _
 *  | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
 *  | |  \ V  V /  __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
 *  |_|   \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
 *                              |___/
 *
 * This file is generated from the documentation data in packages/twenty-ui/generated.
 * To update it, edit the component prop types or design tokens in twenty-ui and run:
 *   npx nx generate:ui twenty-docs
 */}

### NumberField.Root

<ParamField body="Root.allowOutOfRange" type="boolean" default="false">
  Allows typed, pasted, and autofilled values outside min and max. Native range validation still applies; step interactions remain bounded.
</ParamField>

<ParamField body="Root.allowWheelScrub" type="boolean" default="false">
  Allows wheel adjustments while the visible input is focused and hovered. Defaults to false.
</ParamField>

<ParamField body="Root.children" type="ReactNode">
  Composed NumberField parts and supporting content.
</ParamField>

<ParamField body="Root.className" type="string | ((state: NumberFieldRootState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Root.defaultValue" type="number" default="empty">
  Initial uncontrolled number. Omit to start empty; the public type accepts a number.
</ParamField>

<ParamField body="Root.disabled" type="boolean" default="false">
  Prevents interaction and excludes the value from form submission.
</ParamField>

<ParamField body="Root.form" type="string">
  ID of the form owning the hidden native number input.
</ParamField>

<ParamField body="Root.format" type="NumberFormatOptions">
  Intl.NumberFormat options for display and parsing, including currency, units, percent, grouping, and precision. Explicit rounding options can normalize the committed value on blur.
</ParamField>

<ParamField body="Root.id" type="string">
  ID associated with the visible input. Generated when omitted.
</ParamField>

<ParamField body="Root.inputRef" type="Ref&lt;HTMLInputElement&gt;">
  Ref to the hidden native number input used for submission and validation. Use Input.ref to focus the visible text input.
</ParamField>

<ParamField body="Root.largeStep" type="number" default="10">
  Amount used while Shift is held. Defaults to 10.
</ParamField>

<ParamField body="Root.locale" type="LocalesArgument">
  Locale or locale list used to format and parse numbers. Defaults to the runtime locale.
</ParamField>

<ParamField body="Root.max" type="number">
  Inclusive maximum for stepping and native range validation.
</ParamField>

<ParamField body="Root.min" type="number">
  Inclusive minimum for stepping and native range validation.
</ParamField>

<ParamField body="Root.name" type="string">
  Name of the raw numeric value submitted by the hidden input.
</ParamField>

<ParamField body="Root.onValueChange" type="((value: number | null, eventDetails: NumberFieldRootChangeEventDetails) =&gt; void)">
  Receives the next number or null and change details with the native event, reason, cancellation and propagation methods, and optional stepping direction.
</ParamField>

<ParamField body="Root.onValueCommitted" type="((value: number | null, eventDetails: NumberFieldRootCommitEventDetails) =&gt; void)">
  Receives the committed number or null and generic details containing event and reason. Typing commits on blur; pointer steps and scrubbing commit on release; keyboard and wheel changes commit immediately.
</ParamField>

<ParamField body="Root.readOnly" type="boolean" default="false">
  Prevents changes while keeping the visible input focusable.
</ParamField>

<ParamField body="Root.ref" type="Ref&lt;HTMLDivElement&gt;">
  Ref to the root div, or the element composed through Root.render.
</ParamField>

<ParamField body="Root.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldRootState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="Root.required" type="boolean" default="false">
  Requires a numeric value for native form submission.
</ParamField>

<ParamField body="Root.smallStep" type="number" default="0.1">
  Amount used while Alt is held. Defaults to 0.1.
</ParamField>

<ParamField body="Root.snapOnStep" type="boolean" default="false">
  Snaps step interactions to multiples of the active step. Defaults to false.
</ParamField>

<ParamField body="Root.step" type="number | &quot;any&quot;" default="1">
  Base amount for buttons, arrow keys, wheel, and scrubbing. Use any to disable native step validation while stepping by 1.
</ParamField>

<ParamField body="Root.style" type="CSSProperties | ((state: NumberFieldRootState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Root.value" type="number | null">
  Controlled raw numeric value. Use null for an empty field.
</ParamField>

### NumberField.Group

<ParamField body="Group.children" type="ReactNode">
  The visible input and any increment or decrement controls.
</ParamField>

<ParamField body="Group.className" type="string | ((state: NumberFieldGroupState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Group.ref" type="Ref&lt;HTMLDivElement&gt;">
  Ref to the group div, or the element composed through Group.render.
</ParamField>

<ParamField body="Group.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldGroupState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="Group.style" type="CSSProperties | ((state: NumberFieldGroupState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

### NumberField.Input

<ParamField body="Input.aria-roledescription" type="string" default="Number field">
  Describes the role to assistive technology. Defaults to Number field; use Field.Label, aria-label, or aria-labelledby for the accessible name.
</ParamField>

<ParamField body="Input.className" type="string | ((state: NumberFieldInputState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Input.ref" type="Ref&lt;HTMLInputElement&gt;">
  Ref to the visible native text input.
</ParamField>

<ParamField body="Input.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;DetailedHTMLProps&lt;InputHTMLAttributes&lt;HTMLInputElement&gt;, HTMLInputElement&gt;, NumberFieldInputState&gt;">
  Composes the visible text input with an element or render callback. Forward the supplied props and ref to an input. Customize layout through Root or Group.
</ParamField>

<ParamField body="Input.size" type="number">
  Native input size attribute. Use styles to customize visual dimensions.
</ParamField>

<ParamField body="Input.style" type="CSSProperties | ((state: NumberFieldInputState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

### NumberField.Increment

<ParamField body="Increment.children" type="ReactNode">
  Visible content for the increment control. Supply its accessible name.
</ParamField>

<ParamField body="Increment.className" type="string | ((state: NumberFieldIncrementState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Increment.nativeButton" type="boolean" default="true">
  Whether render composes a native button. Set false for a custom non-button element so Base UI supplies button interaction.
</ParamField>

<ParamField body="Increment.ref" type="Ref&lt;HTMLButtonElement&gt;">
  Ref to the increment button, or the element composed through render.
</ParamField>

<ParamField body="Increment.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldIncrementState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="Increment.style" type="CSSProperties | ((state: NumberFieldIncrementState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

### NumberField.Decrement

<ParamField body="Decrement.children" type="ReactNode">
  Visible content for the decrement control. Supply its accessible name.
</ParamField>

<ParamField body="Decrement.className" type="string | ((state: NumberFieldDecrementState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="Decrement.nativeButton" type="boolean" default="true">
  Whether render composes a native button. Set false for a custom non-button element so Base UI supplies button interaction.
</ParamField>

<ParamField body="Decrement.ref" type="Ref&lt;HTMLButtonElement&gt;">
  Ref to the decrement button, or the element composed through render.
</ParamField>

<ParamField body="Decrement.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldDecrementState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="Decrement.style" type="CSSProperties | ((state: NumberFieldDecrementState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

### NumberField.ScrubArea

<ParamField body="ScrubArea.children" type="ReactNode">
  Content the user can drag to adjust the number, plus an optional ScrubAreaCursor.
</ParamField>

<ParamField body="ScrubArea.className" type="string | ((state: NumberFieldScrubAreaState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="ScrubArea.direction" type="&quot;horizontal&quot; | &quot;vertical&quot;" default="horizontal">
  Pointer movement direction used for scrubbing.
</ParamField>

<ParamField body="ScrubArea.pixelSensitivity" type="number" default="2">
  Pixels of pointer movement needed for a step. Larger values reduce sensitivity.
</ParamField>

<ParamField body="ScrubArea.ref" type="Ref&lt;HTMLSpanElement&gt;">
  Ref to the scrub area span, or the element composed through render.
</ParamField>

<ParamField body="ScrubArea.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldScrubAreaState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="ScrubArea.style" type="CSSProperties | ((state: NumberFieldScrubAreaState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="ScrubArea.teleportDistance" type="number">
  Optional distance from the scrub area center at which the pointer loops around.
</ParamField>

### NumberField.ScrubAreaCursor

<ParamField body="ScrubAreaCursor.children" type="ReactNode">
  Custom cursor content shown during supported pointer-lock scrubbing.
</ParamField>

<ParamField body="ScrubAreaCursor.className" type="string | ((state: NumberFieldScrubAreaCursorState) =&gt; string | undefined)">
  Class applied to this part, or a callback receiving its NumberField state.
</ParamField>

<ParamField body="ScrubAreaCursor.ref" type="Ref&lt;HTMLSpanElement&gt;">
  Ref to the cursor span portaled to the document body while active. Null while absent.
</ParamField>

<ParamField body="ScrubAreaCursor.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, NumberFieldScrubAreaCursorState&gt;">
  Composes this part with an element or render callback. Forward the supplied props and ref to the corresponding DOM element.
</ParamField>

<ParamField body="ScrubAreaCursor.style" type="CSSProperties | ((state: NumberFieldScrubAreaCursorState) =&gt; CSSProperties | undefined)">
  Inline styles applied to this part, or a callback receiving its NumberField state.
</ParamField>