BankaiInput

A raw native <input> with a typed size, native disabled/readonly, and a string v-model. It ships no CSS of its own — the theme styles the bankai-input class and its reflected state. This is the single-line text primitive that behavior-rich and wrapper components build on.

Example

Model: (empty)

Types

The named types (-like) are plain text with an on-screen-keyboard hint. Behavior-rich types get their own components so their extra UI and parsing live there, not behind a bare attribute: reach for BankaiInputNumber instead of type="number", and BankaiInputPassword instead of type="password" (planned).

Label, help & validation

BankaiInput is only the control. A label, description, and error message — plus required/invalid handling that avoids the browser's native validation bubble — will be composed by a future BankaiField wrapper, so those concerns are intentionally not on the raw input.

Props

PropTypeDefaultDescription
type'text' | 'email' | 'search' | 'tel' | 'url' | (string)'text'Native input type. A named text step (text/email/search/tel/url) is what this component is for; any other string still passes through. Behavior-rich types have dedicated components (BankaiInputNumber, BankaiInputPassword).
size'sm' | 'md' | 'lg' | (string)'md'Size scale. A named step (sm/md/lg) is themed; any other string reflects verbatim as data-bankai-size as an escape hatch for a custom consumer-styled size.
disabledbooleanfalseDisable the input via the native disabled attribute.
readonlybooleanfalseMake the input read-only via the native readonly attribute — the value shows and can be selected/copied but not edited (and, unlike disabled, it still submits with a form).
model-valuestring—The input's value, bound with v-model — string | undefined (see BankaiInputModelValue): a string once set, undefined while unset. An unset model is never coerced to '', which preserves the "never entered" vs "entered then cleared" distinction a future field/validation layer relies on.

Emits

EventTypeDescription
@update:model-value[value: string | undefined]

Slots

This component has no slots.

Exposes

NameTypeDescription
elHTMLInputElement | nullThe underlying native <input> element, or null before mount / after unmount.
focus(options?: FocusOptions | undefined) => voidFocus the input (delegates to the native HTMLInputElement.focus).
blur() => voidRemove focus from the input (delegates to the native HTMLInputElement.blur).
select() => voidSelect all editable text in the input (delegates to the native HTMLInputElement.select).

Theming

Every token is a :root custom property applied through zero-specificity :where() rules, so a single plain declaration overrides one — no selector, no !important. Set it globally on :root or locally on any ancestor.

TokenDefaultPurpose
--bankai-input-fgvar(--bankai-color-fg)Text color of the value.
--bankai-input-bgvar(--bankai-color-bg)Background fill of the field.
--bankai-input-placeholder-colorvar(--bankai-color-fg-subtle)Color of the placeholder text.
--bankai-input-border-width1pxBorder width.
--bankai-input-border-stylesolidBorder style.
--bankai-input-border-colorvar(--bankai-color-border)Resting border color.
--bankai-input-radiusvar(--bankai-radius)Corner radius.
--bankai-input-inline-size100%Width of the field (100% fills its container by default).
--bankai-input-fontinheritFont shorthand (inherits the surrounding text by default).
--bankai-input-transitioncolor 150ms ease, background-color 150ms ease, border-color 150ms easeTransition applied to color changes.
--bankai-input-focus-ringvar(--bankai-focus-ring)Color of the focus-visible outline.
--bankai-input-focus-border-colorvar(--bankai-color-accent)Border color while focused.
--bankai-input-focus-outline-width2pxWidth of the focus-visible outline.
--bankai-input-focus-outline-offset2pxOffset of the focus-visible outline.
--bankai-input-readonly-bgvar(--bankai-color-surface)Background fill while read-only.
--bankai-input-disabled-opacity0.5Opacity while disabled.
--bankai-input-disabled-cursornot-allowedCursor while disabled.
--bankai-input-sm-padding-yvar(--bankai-space-1)Vertical padding of the small size.
--bankai-input-sm-padding-xvar(--bankai-space-4)Horizontal padding of the small size.
--bankai-input-sm-font-sizevar(--bankai-text-size-sm)Font size of the small size.
--bankai-input-md-padding-yvar(--bankai-space-3)Vertical padding of the medium size.
--bankai-input-md-padding-xvar(--bankai-space-6)Horizontal padding of the medium size.
--bankai-input-md-font-sizevar(--bankai-text-size-md)Font size of the medium size.
--bankai-input-lg-padding-yvar(--bankai-space-4)Vertical padding of the large size.
--bankai-input-lg-padding-xvar(--bankai-space-8)Horizontal padding of the large size.
--bankai-input-lg-font-sizevar(--bankai-text-size-lg)Font size of the large size.