OGE logoOGE

Input Showcase

The differentiators: a character counter that counts what users perceive (grapheme clusters — emoji families are 1 character), a password reveal that keeps the caret, one-click copy with a live-region announcement, locale-aware number formatting and debounced commits with a separate per-keystroke stream.

showCounter mode=password showCopyButton format debounce

Character counter

showCounter renders a live counter in the subscript end slot. It counts what users perceive — grapheme clusters — so a multi-codepoint family emoji or a flag counts as one character, not eight code units. The default limit mode enforces maxLength natively; soft mode lets typing continue past the limit and turns the counter red instead.

grapheme counter soft limit
a family emoji counts as 10 of 40 characters used
0 of 140 characters used

Password reveal & copy

mode='password' automatically adds a reveal toggle that flips the input type in place — the caret position survives and password managers stay attached. showCopyButton adds one-click copy with a transient confirmation announced to screen readers; ideal for API keys and tokens, especially combined with readonly.

password reveal copy to clipboard

Locale-aware numbers

format takes standard Intl.NumberFormatOptions (currency, precision, units) and renders it while the field is unfocused; focusing switches to a raw editable number in the locale's decimal notation. Parsing understands grouped input like 1.234,56. Spin buttons and arrow keys step by step with hold-to-repeat, and values clamp to min/max on commit.

Intl.NumberFormat raw on focus spin + arrows
0–100; arrow keys work too

Debounced commits

debounce delays the committed value (the model, forms and valueCommitted) until typing pauses — ideal for search fields that trigger requests. Blur and Enter flush immediately so nothing is ever lost, while inputChange keeps streaming every raw keystroke if you need it.

debounce inputChange firehose
keystrokes: 0 · committed value: ""