Skip to content

CSS: text-input ​

.instui-text-input — A styled native <input> — including date, time, and datetime-local, where the browser supplies the picker — with validation states and sizes.

Shares its border, background, and state chrome with text-area, simple-select, number-input, and input-group; for date/time/datetime-local types the browser supplies its own picker UI, which this stylesheet doesn't style.

Source: text-input.css

Usage ​

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/text-input.css";

Examples ​

html
<input class="instui-text-input" placeholder="Default">

Modifiers ​

ModifierDescription
.-disabledDisabled state.
.-invalidInvalid (error) state.
.-readonlyRead-only state.
.-size-largeLarge. Long-form alias of -size-lg.
.-size-lgLarge.
.-size-md(default) Medium.
.-size-medium(default) Medium. Long-form alias of -size-md.
.-size-smSmall.
.-size-smallSmall. Long-form alias of -size-sm.
.-successSuccess (valid) state.

Pseudo-elements ​

Pseudo-elementDescription
::placeholderThe placeholder text, in a muted color that shifts on hover.

States ​

StateDescription
:disabled—

Accessibility ​

Associate the field with a visible <label>, use aria-invalid and disabled for state, and explain errors in text, not border color alone. Date and time types use the browser's own picker and keyboard support.

ConditionsRebrand (light)Rebrand (dark)CanvasCanvas High Contrast
forced-colors-focus-visibleWCAG 2.2 1.4.11, 2.4.7PassPassPassPass
more-contrast-respectedWCAG 2.2 1.4.3, 1.4.6PassPassPassPass
reflow-at-320pxWCAG 2.2 1.4.10PassPassPassPass
text-spacing-no-clippingWCAG 2.2 1.4.12PassPassPassPass
Screen reader (simulated)Rebrand (light)Rebrand (dark)CanvasCanvas High Contrast
AnnouncementsPassPassPassPass

These automated results do not establish that the page meets WCAG; manual review is still needed.

Tokens consumed ​

TokenTypeValue
--instui-component-text-input-background-color<color>LightDarklight-dark(#ffffff, #171B21)
--instui-component-text-input-background-disabled-color<color>LightDarklight-dark(#E8EAEC, #334450)
--instui-component-text-input-background-hover-color<color>LightDarklight-dark(#ffffff, #171B21)
--instui-component-text-input-background-readonly-color<color>LightDarklight-dark(#C7CACD, #6A7883)
--instui-component-text-input-border-color<color>LightDarklight-dark(#7E8792, #5F6E7A)
--instui-component-text-input-border-disabled-color<color>LightDarklight-dark(#C7CACD, #4A5B68)
--instui-component-text-input-border-hover-color<color>LightDarklight-dark(#334450, #7E8792)
--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>LightDarklight-dark(#CF1F24, #F56050)
--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-font-weight<integer>500
--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>LightDarklight-dark(#5F6E7A, #7E8792)
--instui-component-text-input-placeholder-hover-color<color>LightDarklight-dark(#334450, #9EA6AD)
--instui-component-text-input-success-border-color<color>LightDarklight-dark(#037D37, #3EA75B)
--instui-component-text-input-text-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-component-text-input-text-disabled-color<color>LightDarklight-dark(#8D959F, #9EA6AD)
--instui-component-text-input-text-readonly-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-focus-outline-color-dangerauto | <color>—
--instui-focus-outline-color-successauto | <color>—
  • text-area — The multi-line counterpart with the same states and sizes.
  • number-input — The numeric-entry input sharing this chrome.
  • simple-select — The native select sharing this field chrome.
  • input-group — Wraps this input with leading and trailing slots.