Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    IbanInput

    A Turkish IBAN field: a fixed TR prefix, digits grouped in fours as they are typed, and a mod 97 check.

    Storybook
    Storybook
    Source
    Source

    The example below loads live from Storybook; open it there to use the controls.

    Live example, StorybookOpen in Storybook

    The TR prefix is fixed in the box; people type only the 24 digits. A pasted “TR33 0006 …” drops its prefix.

    Type or paste the IBAN from your account document.

    import { IbanInput, Provider } from '@bigbang/ui';
    export default function Default() {
    return (
    <Provider locale="en-GB">
    <IbanInput label="IBAN" description="Type or paste the IBAN from your account document." className="max-w-sm" />
    </Provider>
    );
    }

    An IBAN that passes mod 97 gets a check mark; the sample with a changed last digit shows an error.

    The sample IBAN is a published example, not a real account.

    IBAN is valid
    This IBAN is not valid; check the digits.
    import { IbanInput, Provider } from '@bigbang/ui';
    export default function States() {
    return (
    <Provider locale="en-GB">
    <div className="flex max-w-sm flex-col gap-lg">
    <IbanInput label="IBAN" description="The sample IBAN is a published example, not a real account." defaultValue="TR330006100519786457841326" />
    <IbanInput label="IBAN" defaultValue="TR330006100519786457841327" />
    </div>
    </Provider>
    );
    }

    The box uses the same tokens as TextInput.

    The sample IBAN is a published example, not a real account.

    IBAN is valid
    This IBAN is not valid; check the digits.

    The sample IBAN is a published example, not a real account.

    IBAN is valid
    This IBAN is not valid; check the digits.
    import { IbanInput, Provider } from '@bigbang/ui';
    export default function States() {
    return (
    <Provider locale="en-GB">
    <div className="flex max-w-sm flex-col gap-lg">
    <IbanInput label="IBAN" description="The sample IBAN is a published example, not a real account." defaultValue="TR330006100519786457841326" />
    <IbanInput label="IBAN" defaultValue="TR330006100519786457841327" />
    </div>
    </Provider>
    );
    }