---
title: "IBAN Input"
description: "A field for a bank account number (IBAN). It groups the characters in fours, shows the flag and country, and checks the length and check digits."
url: https://gelatinui.com/components/iban-input
markdown_url: https://gelatinui.com/components/iban-input.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/iban-input"
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# IBAN Input

> A field for a bank account number (IBAN). It groups the characters in fours, shows the flag and country, and checks the length and check digits.

Page: https://gelatinui.com/components/iban-input

## When to use it

Best for: One IBAN in groups of four, with the flag of its country and the mod-97 check.

- Use it for a bank account in a country that uses IBANs (most of Europe, the Middle East, and others).
- Check it in a `Field` with `iban().complete` and `iban().valid` from `lib/masks`.
- Add `IbanInputCountry` to name the country next to the IBAN.

## When not to use it

- For a card number, use a [Card Number Input](https://gelatinui.com/components/card-number-input.md).
- For another fixed format, such as a routing number, use a [Masked Input](https://gelatinui.com/components/masked-input.md).

## Notes for agents

- The parts are `IbanInputFlag`, `IbanInputControl`, and `IbanInputCountry`. With no children it renders the flag and the control.
- `onValueChange(text, details)`: `details.unmasked` is the compact IBAN, and `details.country` the two letters.
- A paste with spaces, dashes, lower case, or an "IBAN:" label still fits.
- Use `rawName` on `IbanInputControl` to submit the compact IBAN with a form.
- The mod-97 check finds most typing mistakes. It does not prove that the account exists.

## Anatomy

```text
IbanInput
├─ IbanInputCountry (0..n)
├─ IbanInputFlag (0..n)
└─ IbanInputControl (0..n)
```

## API reference

### IbanInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` | "default" |  |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` | "default" |  |
| `variant` | `"dashed" \| "default"` |  |  |
| `disabled` | `boolean` | false | Turns the control off; the frame fades to 50% with it (the Base UI name). |
| `readOnly` | `boolean` | false | The IBAN shows and can be copied, but not changed (the Base UI name). |
| `value` | `string` |  | The shown IBAN (controlled). A compact one shows in groups of four. |
| `defaultValue` | `string` | "" | The first shown IBAN (uncontrolled). |
| `onValueChange` | `function` |  | Runs on every change with the text, the compact IBAN, the checks, and the country. |
| `locale` | `string` |  | The language of the country name. Default: the display locale (en-US unless a provider sets one). |

### IbanInputCountry

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### IbanInputFlag

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### IbanInputControl

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `guide` | `boolean` |  | The ghost guide of the slots still to fill, while the input has focus. Default `true`. |
| `rawName` | `string` |  | Also submit the raw value under this name (a hidden input), next to the shown one. |
| `rejectFeedback` | `boolean` |  | Nudge the field 2px when the mask rejects a key. Default `true`. |
| `onReject` | `function` |  | Runs when the mask rejects a key (a letter in a number, a 13th month). |
| `ref` | `Ref<HTMLInputElement>` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` |  |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| IbanInput | `iban-input` |  |  |  |
| IbanInputCountry | `iban-input-country` |  |  | `motion-timing` |
| IbanInputFlag | `iban-input-flag` |  |  |  |
| IbanInputControl | `iban-input-control` |  |  |  |

## Usage

Import IBAN Input and compose its parts.

```tsx title="iban-input.tsx"
import { IbanInput, IbanInputControl, IbanInputCountry, IbanInputFlag } from "@/components/ui/pro/iban-input";

export function IbanInputDemo() {
  return (
    <IbanInput>
      <IbanInputFlag />
      <IbanInputControl placeholder="DE89 3704 0044 0532 0130 00" />
      <IbanInputCountry />
    </IbanInput>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/iban-input
```

It adds 33 registry items: 30 files, 5880 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@maskito/core`, `@maskito/kit`, `@maskito/react`, `@phosphor-icons/react`, `clsx`, `country-flag-icons`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Country Flag](https://gelatinui.com/components/country-flag.md)
- [Input Group](https://gelatinui.com/components/input-group.md)
- [Masked Input](https://gelatinui.com/components/masked-input.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Masked Input](https://gelatinui.com/components/masked-input.md)
- [Country Flag](https://gelatinui.com/components/country-flag.md)
- [Input Group](https://gelatinui.com/components/input-group.md)
- [Field](https://gelatinui.com/components/field.md)

## Accessibility

It is a native input, in a `Field` for the label, the help text, and the error.

The flag is decorative. `IbanInputCountry` says the country in text.

## Motion

| Part | Motion |
| --- | --- |
| Flag | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · a new flag fades in and scales from 90% when the country changes |
| Rejected key | indicator · the frame moves 2px to each side and back when the mask rejects a key |
