Skip to content

Input

Displays a form input field or a component that looks like an input field.

Basic

Value:

Example

Disabled

Example

Readonly

Example

Sizes

Example

With Icons

Example

Clearable

Example

Password

Example

Error State

Example

Theming

You can customize the appearance of the input using Tailwind CSS classes or by overriding the CSS variables in your global CSS.

CSS Variables

css
:root {
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

.dark {
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}

Tailwind Customization

You can also use class prop to add custom styles:

vue
<BrInput class="border-blue-500 focus-visible:ring-blue-500" />

API

Props

PropTypeDefaultDescription
modelValuestring | number-The value of the input.
defaultValuestring | number-The default value of the input.
typestringtextHTML input type attribute.
disabledbooleanfalseWhether the input is disabled.
readonlybooleanfalseWhether the input is read-only.
placeholderstring-Placeholder text.
sizexs | sm | md | default | lg | xl | 2xldefaultThe size of the input.
errorbooleanfalseWhether to show error state.
clearablebooleanfalseWhether to show a clear button when input has value.
showPasswordbooleanfalseWhether to show password toggle button (only works with type="password").

Slots

NameDescription
prefixContent to display before the input text.
suffixContent to display after the input text.

Events

NamePayloadDescription
update:modelValuestring | numberEmitted when input value changes.
clear-Emitted when the clear button is clicked.
inputEventEmitted when the input value changes.
changeEventEmitted when the input value changes (on blur or enter).
focusEventEmitted when the input is focused.
blurEventEmitted when the input is blurred.