1.0.18 • Published 11 months ago

react-girocode v1.0.18

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

react-girocode

npm package

A react component for displaying GiroCodes (EPC QR code).

Usage

Import

import Girocode from "react-girocode";

Use

Minimal information:

<Girocode recipient="John Doe" iban="DE23 3702 0500 0008 0901 00" />

The GiroCode of the above example looks like this:

example GiroCode

Typical use case:

<Girocode
  recipient="John Doe"
  iban="DE23 3702 0500 0008 0901 00"
  amount={42}
  text="This is an example"
/>

You can also specify a custom render function if your needs exeed the simple visualization of the qr code:

<Girocode
  recipient="John Doe"
  iban="DE23 3702 0500 0008 0901 00"
  render={(data) => <SomeFancyQrCodeComponent value={data} />}
/>

The render function receives a parameter data which contains the string content of the GiroCode. Please notice that when displaying the GiroCode as qr code the error correction level must be medium.

All available parameters:

interface Props {
  encoding?: Encoding;
  bic?: string;
  recipient: string; // maximum lenght of 70
  iban: string;
  amount?: number;
  reason?: string; // maximum lenght of 4
  reference?: string; // maximum lenght of 25
  text?: string; // maximum lenght of 140
  information?: string; // maximum lenght of 70
  render?: (data: string) => React.ReactNode;
}

The input data gets validated by this package. So the IBAN, BIC and string inputs need to be valid. Some string parameters have a maximum lenght.

Also notice that the parameters reference and text can't be present at the same time.

1.0.18

11 months ago

1.0.17

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago