lightdarkdefaultcompact
Getting StartedInstallationChangelogSupportGithubIntegrationsAngularVueReactDemosFoundationThemesTypographyIconsPopoversInternationalizationStandaloneDrag and DropPopoversKeyboard NavigationVirtual ListLayoutGetting StartedBlockInlineGridComponentsAccordionAlertAlert GroupAvatarBadgeBreadcrumbButtonButton CopyButton GroupButton ExpandButton HandleButton IconButton ResizeButton SortCardChatCheckboxColorData GridDateDialogDividerDrawerDropdownFileFormat BytesFormat DatetimeFormat NumberFormat Relative TimeFormat TokenFormsForm InteractionsForm ValidationHeaderIconInputMenuMonthNavNumberNumber StepperPagePaginationPanelPasswordPinProgress BarProgress CircleProgress DotRadioRangeRatingSearchSelectSkeletonStepperSwitchTabsTagTelephoneTextareaTimeToastToggletipTooltipTreeData GridGetting StartedFooterPlaceholderAsyncResponsiveHeightPaginationBordersHoverLayerRange SelectionCSVClipboardColumn AlignmentColumn WidthColumn FixedColumn StickyColumn VisibilityColumn GroupsColumn SpanColumn ResizeDraggable ColumnsDraggable RowsRow HeaderRow Multi SelectRow Single SelectRow HeightRow ActionRow Action BulkRow StickyRow StripeRow FixedRow SortRow GroupsVirtual List

Number Stepper

A number input with explicit increment/decrement buttons in a horizontal minus-input-plus layout

A number input with explicit increment/decrement buttons in a horizontal minus-input-plus layout. This component provides a more touch-friendly and visually explicit interface for numeric input compared to standard number inputs.

Example

Select quantity
code
<script type="module">
  import '@blueprintui/components/include/number-stepper.js';
</script>

<bp-field>
  <label>Quantity</label>
  <bp-number-stepper value="1" min="0" max="10" step="1"></bp-number-stepper>
  <bp-field-message>Select quantity</bp-field-message>
</bp-field>

Continuous

Hold buttons to adjust quickly
code
<bp-form-group layout="vertical">
  <bp-field>
    <label>Volume (Hold to repeat)</label>
    <bp-number-stepper value="50" min="0" max="100" continuous continuous-delay="300" continuous-interval="50"></bp-number-stepper>
    <bp-field-message>Hold buttons to adjust quickly</bp-field-message>
  </bp-field>

  <bp-field>
    <label>Brightness (Hold to repeat)</label>
    <bp-number-stepper value="75" min="0" max="100" continuous></bp-number-stepper>
  </bp-field>
</bp-form-group>

Disabled

code
<bp-form-group layout="vertical">
  <bp-field>
    <label>Disabled</label>
    <bp-number-stepper value="5" min="0" max="10" disabled></bp-number-stepper>
  </bp-field>
</bp-form-group>

Validation

Minimum team size is 1Maximum team size is 10
code
<bp-form-group layout="vertical">
  <bp-field validate>
    <label>Team Size</label>
    <bp-number-stepper value="5" min="1" max="10" required></bp-number-stepper>
    <bp-field-message error="rangeUnderflow">Minimum team size is 1</bp-field-message>
    <bp-field-message error="rangeOverflow">Maximum team size is 10</bp-field-message>
  </bp-field>
</bp-form-group>

Vertical

Select quantity
code
<bp-form-group layout="vertical">
  <bp-field>
    <label>Quantity</label>
    <bp-number-stepper value="1" min="0" max="10"></bp-number-stepper>
    <bp-field-message>Select quantity</bp-field-message>
  </bp-field>

  <bp-field>
    <label>Price</label>
    <bp-number-stepper value="100" min="0" max="1000" step="10"></bp-number-stepper>
  </bp-field>
</bp-form-group>

Horizontal

code
<bp-form-group layout="horizontal">
  <bp-field>
    <label>Width</label>
    <bp-number-stepper value="800" min="100" max="1920" step="10"></bp-number-stepper>
  </bp-field>

  <bp-field>
    <label>Height</label>
    <bp-number-stepper value="600" min="100" max="1080" step="10"></bp-number-stepper>
  </bp-field>
</bp-form-group>

Compact

code
<bp-form-group layout="compact">
  <bp-field>
    <label>Rows</label>
    <bp-number-stepper value="10" min="1" max="100"></bp-number-stepper>
  </bp-field>

  <bp-field>
    <label>Columns</label>
    <bp-number-stepper value="10" min="1" max="100"></bp-number-stepper>
  </bp-field>
</bp-form-group>

Install

NPM

// npm package
import '@blueprintui/components/include/number-stepper.js';

CDN

<script type="module">
  import 'https://cdn.jsdelivr.net/npm/@blueprintui/components/include/number-stepper.js/+esm';
</script>

Accessibility

  • Keyboard Navigation: Tab to focus input, arrow keys work within input, Space/Enter activate focused stepper buttons
  • ARIA Attributes: Stepper buttons have aria-label="increment" and aria-label="decrement", input has role="spinbutton" with aria-valuemin, aria-valuemax, aria-valuenow
  • Button States: Decrement button disabled at min value, increment button disabled at max value
  • Focus Management: Clear focus indicators on input and buttons
  • Screen Reader: Announces current value and button availability

Behavior Notes

  1. Button States: Decrement button automatically disables when value reaches min, increment button disables at max
  2. Validation: Manual input is validated against min, max, and step values
  3. Keyboard Shortcuts: When input is focused, arrow up/down increment/decrement by step value
  4. Continuous Stepping: When continuous is enabled, holding a button will repeatedly increment/decrement

bp-number-stepper

Events

NameTypesDescription
inputInputEventoccurs when the value changes (real-time, during typing)
changeInputEventoccurs when value is committed (blur, enter, or button click)

Properties

NameTypesDescription
continuousbooleanenable hold-to-repeat on stepper buttons
continuousDelaynumberdelay in ms before continuous stepping starts
continuousIntervalnumberinterval in ms for continuous stepping
i18nI18nStrings['actions']Provides internationalization strings for accessibility labels and screen reader announcements
focus
blur
stepUpIncrements the value by the step amount
stepDownDecrements the value by the step amount
valuenumber
stepnumber

Attributes

NameTypesDescription
continuousbooleanenable hold-to-repeat on stepper buttons
continuous-delaynumberdelay in ms before continuous stepping starts
continuous-intervalnumberinterval in ms for continuous stepping
i18nI18nStrings['actions']Provides internationalization strings for accessibility labels and screen reader announcements

CSS Properties

NameTypesDescription
--backgroundBackground color of input field
--colorText color
--borderBorder style
--border-radiusBorder radius
--outlineOutline style (focus state)
--outline-offsetOutline offset
--paddingInput field padding
--font-sizeFont size
--heightComponent height
--widthComponent width
--min-widthMinimum width
--gapGap between elements
--text-alignText alignment in input field