CSS: number-input
.instui-number-input — A number-input facade with a +/- spinner column.
Source: number-input.ts
Accessibility
Put the accessible name on the <input> (e.g. aria-label) so the field owns the value; the +/- spinner buttons are decorative and marked aria-hidden="true".
Usage
css
@import "@pantoken/components/components.css";
@import "@pantoken/components/number-input.css";Examples
html
<span class="instui-number-input">
<input id="qty" type="number" value="1" aria-label="Quantity">
<span class="arrows">
<button type="button" id="up" aria-hidden="true"></button>
<button class="down" type="button" id="down" aria-hidden="true"></button>
</span>
</span>Structure
text
.instui-number-input
input
.arrows
button
.downflowchart TD
n0[".instui-number-input"]:::cssdoc-root
n1("input"):::cssdoc-part
n2(".arrows"):::cssdoc-part
n3("button"):::cssdoc-part
n4(".down"):::cssdoc-part
n0 --> n1
n2 --> n3
n2 --> n4
n0 --> n2
classDef cssdoc-root stroke-width:1px;
classDef cssdoc-part stroke-width:1px;
classDef cssdoc-slot stroke-width:1px;
classDef cssdoc-component stroke-width:1px;
Modifiers
| Modifier | Description |
|---|---|
.-disabled | Disabled state. |
.-invalid | Invalid (error) state. |
.-readonly | Read-only state. |
.-size-large | Large. Long-form alias of -size-lg. |
.-size-lg | Large. |
.-size-sm | Small. |
.-size-small | Small. Long-form alias of -size-sm. |
.-success | Success (valid) state. |
Parts
| Part | Description |
|---|---|
.arrows | The +/- spinner column at the inline-end. |
.down | The decrement button; the unclassed button increments. |
Pseudo-elements
| Pseudo-element | Description |
|---|---|
::before | The masked chevron glyph on each spinner button: up to increment, down on .down. |
::placeholder | The placeholder text of the inner input, in a muted color. |
States
| State | Description |
|---|---|
:disabled | — |
Tokens consumed
| Token | Type | Value |
|---|---|---|
--instui-color-icon-interactive-action-secondary-base | <color> | light-dark(#1D354F, #ffffff)LightDark |
--instui-component-text-input-arrows-background-active-color | <color> | light-dark(#B6CCEA, #2E5177)LightDark |
--instui-component-text-input-arrows-background-color | <color> | light-dark(#44709F, #86A8D5)LightDark |
--instui-component-text-input-arrows-background-disabled-color | <color> | light-dark(#DFE1E3, #334450)LightDark |
--instui-component-text-input-arrows-background-hover-color | <color> | light-dark(#44709F, #86A8D5)LightDark |
--instui-component-text-input-background-color | <color> | light-dark(#ffffff, #171B21)LightDark |
--instui-component-text-input-background-disabled-color | <color> | light-dark(#E8EAEC, #334450)LightDark |
--instui-component-text-input-background-hover-color | <color> | light-dark(#ffffff, #171B21)LightDark |
--instui-component-text-input-background-readonly-color | <color> | light-dark(#C7CACD, #6A7883)LightDark |
--instui-component-text-input-border-color | <color> | light-dark(#7E8792, #5F6E7A)LightDark |
--instui-component-text-input-border-disabled-color | <color> | light-dark(#C7CACD, #4A5B68)LightDark |
--instui-component-text-input-border-hover-color | <color> | light-dark(#334450, #7E8792)LightDark |
--instui-component-text-input-border-radius | <length> | 0.75rem |
--instui-component-text-input-border-readonly-color | <color> | #8D959F |
--instui-component-text-input-border-width | <length> | 0.0625rem |
--instui-component-text-input-error-border-color | <color> | light-dark(#CF1F24, #F56050)LightDark |
--instui-component-text-input-font-family | [ <font-family-name> | <generic-font-family> ]# | Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif |
--instui-component-text-input-font-size-lg | <length> | 1.25rem |
--instui-component-text-input-font-size-md | <length> | 1rem |
--instui-component-text-input-font-size-sm | <length> | 0.875rem |
--instui-component-text-input-gap-content | <length> | 0.75rem |
--instui-component-text-input-height-lg | <length> | 3rem |
--instui-component-text-input-height-md | <length> | 2.5rem |
--instui-component-text-input-height-sm | <length> | 2rem |
--instui-component-text-input-padding-horizontal-lg | <length> | 0.75rem |
--instui-component-text-input-padding-horizontal-md | <length> | 0.75rem |
--instui-component-text-input-padding-horizontal-sm | <length> | 0.5rem |
--instui-component-text-input-placeholder-color | <color> | light-dark(#5F6E7A, #7E8792)LightDark |
--instui-component-text-input-success-border-color | <color> | light-dark(#037D37, #3EA75B)LightDark |
--instui-component-text-input-text-color | <color> | light-dark(#273540, #ffffff)LightDark |
--instui-component-text-input-text-disabled-color | <color> | light-dark(#8D959F, #9EA6AD)LightDark |
--instui-component-text-input-text-readonly-color | <color> | light-dark(#273540, #ffffff)LightDark |
--instui-focus-outline-color | <color> | invert | — |
--instui-focus-outline-color-danger | <color> | invert | — |
--instui-focus-outline-color-success | <color> | invert | — |
--instui-focus-outline-offset | <length> | — |
--instui-focus-outline-radius | <length> | — |
--instui-focus-outline-style | auto | none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | — |
--instui-focus-outline-width | <length> | — |
--instui-icon-chevron-down | <image> | url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E') |
--instui-icon-chevron-up | <image> | url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m18%2015-6-6-6%206%22%2F%3E%3C%2Fsvg%3E') |
Related
- text-input — Shares the same input facade chrome.
- range-input — Another numeric input control.