Input
A text field.
Pick a date in October.
In context
Invite to Tideline
Password reveal
Only you can read your journal. We cannot reset this.
Reconciliation journal
Reconciliation journal
Create
Choose a passphrase
The passphrases do not match.
Type, padding and focus tokens
Props
| Prop | Type | Required | Default |
|---|---|---|---|
size | "sm" | "md" | "lg" | undefined | No | md |
invalid | boolean | undefined | No | — |
mask | string | undefined | No | — |
revealable | boolean | { visible: boolean; onVisibleChange?: ((visible: boolean) => void) | undefined; } | undefined | No | — |
autoHide | boolean | undefined | No | — |
startIcon | ReactNode | No | — |
fieldStyle | "solid" | "translucent" | undefined | No | — |
revealIcons | { show: ReactNode; hide: ReactNode; } | undefined | No | — |
revealStyle | "default" | "plain" | undefined | No | — |
toggleLabels | { show: string; hide: string; } | undefined | No | — |
Accessibility
A plain <input>: wrap it in a <label> or pass aria-label. mask shapes what is typed (9 digit, a letter, * any, other characters are literals); it does not validate, so pair it with pattern or required and say the constraint in words.
data-rebar-* attributes
data-rebar-size on the element; otherwise a native <input> with every native attribute passed through.
Migrating to Ant Design
Not codemod-covered: AntD's Input has no mask. A masked field needs a mask library alongside AntD's Input.
fieldStyle, revealIcons, revealStyle
fieldStyle="translucent" is a glass field for photo or dark surfaces (--rebar-auth-field-* tokens). revealIcons={{ show, hide }} swaps the eye glyphs and revealStyle="plain" makes the eye a bare 70% glyph inset by --rebar-input-reveal-inset.
Tokens
Custom properties, set on the component or any ancestor. The default is what applies when one is unset. 3 of 27 were added in 1.1.0 and are marked.
| Property | Default | |
|---|---|---|
--rebar-input-background | var(--rebar-color-bg-raised, var(--rebar-color-bg-primary)) | |
--rebar-input-border-color | var(--rebar-color-border, #e0e0e0) | |
--rebar-input-border-width | 1.5px | |
--rebar-input-color | var(--rebar-color-text-primary, #212121) | |
--rebar-input-disabled-background | var(--rebar-input-background, var(--rebar-color-bg-raised, var(--rebar-color-bg-primary))) | |
--rebar-input-disabled-color | var(--rebar-color-text-primary, #212121) | |
--rebar-input-disabled-opacity | 0.6 | |
--rebar-input-focus-border-color | var(--rebar-color-primary) | |
--rebar-input-focus-outline | none | |
--rebar-input-focus-outline-offset | 2px | |
--rebar-input-focus-shadow | 0 0 0 4px color-mix(in srgb, var(--rebar-color-primary) 18%, transparent) | |
--rebar-input-font-size | var(--rebar-font-size-sm, 14px) | |
--rebar-input-font-weight | 400 | |
--rebar-input-invalid-border-color | var(--rebar-color-danger) | 1.1 |
--rebar-input-invalid-focus-shadow | var(--rebar-input-invalid-shadow, 0 0 0 4px color-mix(in srgb, var(--rebar-color-danger) 24%, transparent)) | 1.1 |
--rebar-input-invalid-shadow | 0 0 0 4px color-mix(in srgb, var(--rebar-color-danger) 14%, transparent) | 1.1 |
--rebar-input-line-height | normal | |
--rebar-input-min-height | 46px | |
--rebar-input-min-height-lg | 54px | |
--rebar-input-min-height-sm | 36px | |
--rebar-input-padding | 0 18px | |
--rebar-input-placeholder-color | var(--rebar-color-text-secondary) | |
--rebar-input-radius | 999px | |
--rebar-input-reveal-color | inherit | |
--rebar-input-reveal-font-size | 13.3333px | |
--rebar-input-reveal-inset | 10px | |
--rebar-input-text-overflow | ellipsis |