NumericKeypad
NumericKeypad
Section titled “NumericKeypad”Category: Forms & inputs
const [pin, setPin] = useState('');
<NumericKeypad onDigit={(d) => setPin((p) => (p + d).slice(0, 6))} onBackspace={() => setPin((p) => p.slice(0, -1))}/>
{/* With submit */}<NumericKeypad onDigit={…} submitLabel="Pay" onSubmit={() => pay(amount)}/>Install: @helix-ui/core
import { NumericKeypad } from '@helix-ui/core';status: stable · since: 0.5.0
Tags: mobile, keypad, pin, numeric
Anatomy
Section titled “Anatomy”1 2 34 5 67 8 9 0 ⌫Layout
Section titled “Layout”- display —
grid - width —
fill - height —
content - intrinsicSize —
3×4 grid; tile size scales with width - stackable —
false - fullBleed —
false
Visual
Section titled “Visual”A 3×4 grid of large round buttons (44px+) with optional letter sub-labels (ABC, DEF, …) for phone-style entry. Backspace key in the bottom-right.
| Name | Type | Default | Description |
|---|---|---|---|
onDigit |
(digit: string) => void |
— | Called for each digit press 0–9. |
onBackspace |
() => void |
— | Called when backspace is tapped (when no submitLabel). |
onSubmit |
() => void |
— | Called when the submit key is tapped (when submitLabel is set). |
bottomLeft |
ReactNode |
— | Custom node for the bottom-left cell (default empty). |
bottomRight |
ReactNode |
— | Custom node for the bottom-right cell (default backspace). |
submitLabel |
ReactNode |
— | When set, renders a brand-colored submit button at bottom-right and triggers onSubmit instead of backspace. |
size |
'md' | 'lg' |
md |
Key height — 56 / 72 px. |
Tokens used
Section titled “Tokens used”color.bg.action.neutral.default, color.bg.action.neutral.hover, color.bg.action.neutral.active, color.bg.action.brand.default, color.bg.action.brand.hover, color.text.primary, color.text.on.brand, color.text.muted, color.border.focus, radius.full, space.2, space.3, font.family.sans, font.size.2xl, font.weight.medium, font.weight.semibold
Accessibility
Section titled “Accessibility”Notes
- Each key is a
<button>with anaria-label(“Digit 1”). The wrapper isrole="group". - For currency inputs, set
bottomLeftto a decimal.button.
Composes with
Section titled “Composes with”| Component | Relation | Note |
|---|---|---|
PinInput |
sibling |
Often paired with PinInput for mobile PIN entry. |
Prompt examples
Section titled “Prompt examples”These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.
mobile PIN entry
Section titled “mobile PIN entry”“on-screen numeric keypad”
<NumericKeypad onDigit={handleDigit} onBackspace={handleBackspace} />