--- title: NumberField description: Collect numerical values from users with optimized keyboard settings and built-in validation. api_version: 2025-10 api_name: checkout-ui-extensions source_url: html: https://shopify.dev/docs/api/checkout-ui-extensions/latest/polaris-web-components/forms/numberfield md: https://shopify.dev/docs/api/checkout-ui-extensions/latest/polaris-web-components/forms/numberfield.md --- # Number​Field Collect numerical values from users with optimized keyboard settings and built-in validation. ## Properties * autocomplete AutocompleteField | \`${AutocompleteSection} ${AutocompleteField}\` | \`${AutocompleteGroup} ${AutocompleteField}\` | \`${AutocompleteSection} ${AutocompleteGroup} ${AutocompleteField}\` | "on" | "off" Default: 'on' for everything else A hint as to the intended content of the field. When set to `on` (the default), this property indicates that the field should support autofill, but you do not have any more semantic information on the intended contents. When set to `off`, you are indicating that this field contains sensitive information, or contents that are never saved, like one-time codes. Alternatively, you can provide value which describes the specific data you would like to be entered into this field during autofill. * controls 'auto' | 'stepper' | 'none' Default: 'auto' Sets the type of controls displayed in the field. * `stepper`: displays buttons to increase or decrease the value of the field by the stepping interval defined in the `step` property. Appropriate mouse and [keyboard interactions](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role#keyboard_interactions) to control the value of the field are enabled. * `none`: no controls are displayed and users must input the value manually. Arrow keys and scroll wheels can’t be used either to avoid accidental changes. * `auto`: the presence of the controls depends on the surface and context. * defaultValue string The default value for the field. * details string Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user. This will also be exposed to screen reader users. * disabled boolean Default: false Disables the field, disallowing any interaction. * error string Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately. * icon IconType | AnyString Default: '' The type of icon to be displayed in the field. * id string A unique identifier for the element. * inputMode 'decimal' | 'numeric' Default: 'decimal' Sets the virtual keyboard. * label string Content to use as the field label. * labelAccessibilityVisibility 'visible' | 'exclusive' Default: 'visible' Changes the visibility of the component's label. * `visible`: the label is visible to all users. * `exclusive`: the label is visually hidden but remains in the accessibility tree. * max number Default: Infinity The highest decimal or integer to be accepted for the field. When used with `step` the value will round down to the max number. Note: a user will still be able to use the keyboard to input a number higher than the max. It is up to the developer to add appropriate validation. * min number Default: -Infinity The lowest decimal or integer to be accepted for the field. When used with `step` the value will round up to the min number. Note: a user will still be able to use the keyboard to input a number lower than the min. It is up to the developer to add appropriate validation. * name string An identifier for the field that is unique within the nearest containing form. * prefix string Default: '' A value to be displayed immediately before the editable portion of the field. This is useful for displaying an implied part of the value, such as "https\://" or "+353". This cannot be edited by the user, and it isn't included in the value of the field. It may not be displayed until the user has interacted with the input. For example, an inline label may take the place of the prefix until the user focuses the input. * readOnly boolean Default: false The field cannot be edited by the user. It is focusable will be announced by screen readers. * required boolean Default: false Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the `error` property. * step number Default: 1 The amount the value can increase or decrease by. This can be an integer or decimal. If a `max` or `min` is specified with `step` when increasing/decreasing the value via the buttons, the final value will always round to the `max` or `min` rather than the closest valid amount. * suffix string Default: '' A value to be displayed immediately after the editable portion of the field. This is useful for displaying an implied part of the value, such as "@shopify.com", or "%". This cannot be edited by the user, and it isn't included in the value of the field. It may not be displayed until the user has interacted with the input. For example, an inline label may take the place of the suffix until the user focuses the input. * value string The current value for the field. If omitted, the field will be empty. ### AutocompleteSection The “section” scopes the autocomplete data that should be inserted to a specific area of the page. Commonly used when there are multiple fields with the same autocomplete needs in the same page. For example: 2 shipping address forms in the same page. ```ts `section-${string}` ``` ### AutocompleteGroup The contact information group the autocomplete data should be sourced from. ```ts "shipping" | "billing" ``` ### IconType ```ts 'product' | 'variant' | 'cart' | 'payment' | 'wallet' | 'code' | 'phone' | 'target' | 'metafields' | 'note' | 'settings' | 'key' | 'paste' | 'play' | 'reset' | 'select' | 'button' | 'link' | 'map' | 'menu' | 'search' | 'table' | 'circle' | 'filter' | 'image' | 'text' | 'view' | 'alert-circle' | 'alert-triangle-filled' | 'alert-triangle' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up-right' | 'arrow-up' | 'bag' | 'bullet' | 'calendar' | 'camera' | 'caret-down' | 'cash-dollar' | 'categories' | 'check-circle' | 'check' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'clipboard' | 'clock' | 'credit-card' | 'delete' | 'delivered' | 'delivery' | 'disabled' | 'discount' | 'edit' | 'email' | 'empty' | 'external' | 'geolocation' | 'gift-card' | 'globe' | 'grid' | 'info-filled' | 'info' | 'list-bulleted' | 'location' | 'lock' | 'menu-horizontal' | 'menu-vertical' | 'minus' | 'mobile' | 'order' | 'organization' | 'plus' | 'profile' | 'question-circle-filled' | 'question-circle' | 'reorder' | 'return' | 'savings' | 'star-filled' | 'star-half' | 'star' | 'store' | 'truck' | 'upload' | 'x-circle-filled' | 'x-circle' | 'x' | 'color' | 'adjust' | 'affiliate' | 'airplane' | 'alert-bubble' | 'alert-diamond' | 'alert-location' | 'alert-octagon' | 'alert-octagon-filled' | 'app-extension' | 'apps' | 'archive' | 'arrow-down-circle' | 'arrow-down-right' | 'arrow-left-circle' | 'arrow-right-circle' | 'arrow-up-circle' | 'arrows-in-horizontal' | 'arrows-out-horizontal' | 'attachment' | 'automation' | 'backspace' | 'bank' | 'barcode' | 'battery-low' | 'bill' | 'blank' | 'blog' | 'bolt' | 'bolt-filled' | 'book' | 'book-open' | 'bug' | 'business-entity' | 'button-press' | 'calculator' | 'calendar-check' | 'calendar-compare' | 'calendar-list' | 'calendar-time' | 'camera-flip' | 'caret-left' | 'caret-right' | 'caret-up' | 'cart-abandoned' | 'cart-discount' | 'cart-down' | 'cart-filled' | 'cart-sale' | 'cart-send' | 'cart-up' | 'cash-euro' | 'cash-pound' | 'cash-rupee' | 'cash-yen' | 'catalog-product' | 'channels' | 'chart-cohort' | 'chart-donut' | 'chart-funnel' | 'chart-histogram-first' | 'chart-histogram-first-last' | 'chart-histogram-flat' | 'chart-histogram-full' | 'chart-histogram-growth' | 'chart-histogram-last' | 'chart-histogram-second-last' | 'chart-horizontal' | 'chart-line' | 'chart-popular' | 'chart-stacked' | 'chart-vertical' | 'chat' | 'chat-new' | 'chat-referral' | 'check-circle-filled' | 'checkbox' | 'chevron-down-circle' | 'chevron-left-circle' | 'chevron-right-circle' | 'chevron-up-circle' | 'circle-dashed' | 'clipboard-check' | 'clipboard-checklist' | 'clock-revert' | 'code-add' | 'collection' | 'collection-featured' | 'collection-list' | 'collection-reference' | 'color-none' | 'compass' | 'complete' | 'compose' | 'confetti' | 'connect' | 'content' | 'contract' | 'corner-pill' | 'corner-round' | 'corner-square' | 'credit-card-cancel' | 'credit-card-percent' | 'credit-card-reader' | 'credit-card-reader-chip' | 'credit-card-reader-tap' | 'credit-card-secure' | 'credit-card-tap-chip' | 'crop' | 'currency-convert' | 'cursor' | 'cursor-banner' | 'cursor-option' | 'data-presentation' | 'data-table' | 'database' | 'database-add' | 'database-connect' | 'desktop' | 'disabled-filled' | 'discount-add' | 'discount-automatic' | 'discount-code' | 'discount-remove' | 'dns-settings' | 'dock-floating' | 'dock-side' | 'domain' | 'domain-landing-page' | 'domain-new' | 'domain-redirect' | 'download' | 'drag-drop' | 'drag-handle' | 'drawer' | 'duplicate' | 'email-follow-up' | 'email-newsletter' | 'enabled' | 'enter' | 'envelope' | 'envelope-soft-pack' | 'eraser' | 'exchange' | 'exit' | 'export' | 'eye-check-mark' | 'eye-dropper' | 'eye-dropper-list' | 'eye-first' | 'eyeglasses' | 'fav' | 'favicon' | 'file' | 'file-list' | 'filter-active' | 'flag' | 'flip-horizontal' | 'flip-vertical' | 'flower' | 'folder' | 'folder-add' | 'folder-down' | 'folder-remove' | 'folder-up' | 'food' | 'foreground' | 'forklift' | 'forms' | 'games' | 'gauge' | 'gift' | 'git-branch' | 'git-commit' | 'git-repository' | 'globe-asia' | 'globe-europe' | 'globe-lines' | 'globe-list' | 'graduation-hat' | 'hashtag' | 'hashtag-decimal' | 'hashtag-list' | 'heart' | 'hide' | 'hide-filled' | 'home' | 'home-filled' | 'icons' | 'identity-card' | 'image-add' | 'image-alt' | 'image-explore' | 'image-magic' | 'image-none' | 'image-with-text-overlay' | 'images' | 'import' | 'in-progress' | 'incentive' | 'incoming' | 'incomplete' | 'inheritance' | 'inventory' | 'inventory-edit' | 'inventory-list' | 'inventory-transfer' | 'inventory-updated' | 'iq' | 'keyboard' | 'keyboard-filled' | 'keyboard-hide' | 'keypad' | 'label-printer' | 'language' | 'language-translate' | 'layout-block' | 'layout-buy-button' | 'layout-buy-button-horizontal' | 'layout-buy-button-vertical' | 'layout-column-1' | 'layout-columns-2' | 'layout-columns-3' | 'layout-footer' | 'layout-header' | 'layout-logo-block' | 'layout-popup' | 'layout-rows-2' | 'layout-section' | 'layout-sidebar-left' | 'layout-sidebar-right' | 'lightbulb' | 'link-list' | 'list-bulleted-filled' | 'list-numbered' | 'live' | 'live-critical' | 'live-none' | 'location-none' | 'markets' | 'markets-euro' | 'markets-rupee' | 'markets-yen' | 'maximize' | 'measurement-size' | 'measurement-size-list' | 'measurement-volume' | 'measurement-volume-list' | 'measurement-weight' | 'measurement-weight-list' | 'media-receiver' | 'megaphone' | 'mention' | 'menu-filled' | 'merge' | 'metaobject' | 'metaobject-list' | 'metaobject-reference' | 'microphone' | 'minimize' | 'minus-circle' | 'money' | 'money-none' | 'money-split' | 'moon' | 'nature' | 'note-add' | 'notification' | 'order-batches' | 'order-draft' | 'order-filled' | 'order-first' | 'order-fulfilled' | 'order-repeat' | 'order-unfulfilled' | 'orders-status' | 'outdent' | 'outgoing' | 'package' | 'package-cancel' | 'package-fulfilled' | 'package-on-hold' | 'package-reassign' | 'package-returned' | 'page' | 'page-add' | 'page-attachment' | 'page-clock' | 'page-down' | 'page-heart' | 'page-list' | 'page-reference' | 'page-remove' | 'page-report' | 'page-up' | 'pagination-end' | 'pagination-start' | 'paint-brush-flat' | 'paint-brush-round' | 'paper-check' | 'partially-complete' | 'passkey' | 'pause-circle' | 'payment-capture' | 'payout' | 'payout-dollar' | 'payout-euro' | 'payout-pound' | 'payout-rupee' | 'payout-yen' | 'person' | 'person-add' | 'person-exit' | 'person-filled' | 'person-list' | 'person-lock' | 'person-remove' | 'person-segment' | 'personalized-text' | 'phablet' | 'phone-in' | 'phone-out' | 'pin' | 'pin-remove' | 'plan' | 'play-circle' | 'plus-circle' | 'plus-circle-down' | 'plus-circle-filled' | 'plus-circle-up' | 'point-of-sale' | 'point-of-sale-register' | 'price-list' | 'print' | 'product-add' | 'product-cost' | 'product-filled' | 'product-list' | 'product-reference' | 'product-remove' | 'product-return' | 'product-unavailable' | 'profile-filled' | 'receipt' | 'receipt-dollar' | 'receipt-euro' | 'receipt-folded' | 'receipt-paid' | 'receipt-pound' | 'receipt-refund' | 'receipt-rupee' | 'receipt-yen' | 'receivables' | 'redo' | 'referral-code' | 'refresh' | 'remove-background' | 'replace' | 'replay' | 'reward' | 'rocket' | 'rotate-left' | 'rotate-right' | 'sandbox' | 'save' | 'scan-qr-code' | 'search-add' | 'search-list' | 'search-recent' | 'search-resource' | 'send' | 'share' | 'shield-check-mark' | 'shield-none' | 'shield-pending' | 'shield-person' | 'shipping-label' | 'shipping-label-cancel' | 'shopcodes' | 'slideshow' | 'smiley-happy' | 'smiley-joy' | 'smiley-neutral' | 'smiley-sad' | 'social-ad' | 'social-post' | 'sort' | 'sort-ascending' | 'sort-descending' | 'sound' | 'sports' | 'star-circle' | 'star-list' | 'status' | 'status-active' | 'stop-circle' | 'store-import' | 'store-managed' | 'store-online' | 'sun' | 'table-masonry' | 'tablet' | 'tax' | 'team' | 'text-align-center' | 'text-align-left' | 'text-align-right' | 'text-block' | 'text-bold' | 'text-color' | 'text-font' | 'text-font-list' | 'text-grammar' | 'text-in-columns' | 'text-in-rows' | 'text-indent' | 'text-indent-remove' | 'text-italic' | 'text-quote' | 'text-title' | 'text-underline' | 'text-with-image' | 'theme' | 'theme-edit' | 'theme-store' | 'theme-template' | 'three-d-environment' | 'thumbs-down' | 'thumbs-up' | 'tip-jar' | 'toggle-off' | 'toggle-on' | 'transaction' | 'transaction-fee-add' | 'transaction-fee-dollar' | 'transaction-fee-euro' | 'transaction-fee-pound' | 'transaction-fee-rupee' | 'transaction-fee-yen' | 'transfer' | 'transfer-in' | 'transfer-internal' | 'transfer-out' | 'undo' | 'unknown-device' | 'unlock' | 'viewport-narrow' | 'viewport-short' | 'viewport-tall' | 'viewport-wide' | 'wand' | 'watch' | 'wifi' | 'work' | 'work-list' | 'wrench' ``` ### AnyString Prevents widening string literal types in a union to \`string\`. ```ts string & {} ``` ## Events * blur ((event: CallbackEventListener\) => void) | null Callback when the element loses focus. * change ((event: CallbackEventListener\) => void) | null Callback when the user has **finished editing** a field, e.g. once they have blurred the field. * focus ((event: CallbackEventListener\) => void) | null Callback when the element receives focus. * input ((event: CallbackEventListener\) => void) | null Callback when the user makes any changes in the field. ### CallbackEventListener ```ts (EventListener & { (event: CallbackEvent): void; }) | null ``` ### CallbackEvent ```ts TEvent & { currentTarget: HTMLElementTagNameMap[TTagName]; } ``` ## Slots * accessory HTMLElement Additional content to be displayed in the field. Commonly used to display an icon that activates a tooltip providing more information. ### Examples * #### Code ##### Default ```html ``` ## Preview ![](https://shopify.dev/images/templated-apis-screenshots/checkout-ui-extensions/2025-10/number-field-default.png)