Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape authored Dec 21, 2023
1 parent d327782 commit 4f0b9b8
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions docs/components/qrcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ type: component

<!--@include: @/include/header.md-->

::: warning
This component utilizes the base64 image format to inline the QR Code image. Please note that not all email clients support that image format. See https://www.caniemail.com/features/image-base64/ for more information.
:::

<!--@include: @/include/install.md-->

## Usage
Expand All @@ -27,7 +31,16 @@ The `QrCode` component generates a QR code based on the provided `src` prop. It

## Component Props

In addition to expressing all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'img'>`, `QrCode` accepts the following custom props:
```ts
interface QrProps extends RootProps {
correctionLevel: 'L' | 'M' | 'H';
height?: number;
size: number;
src: string;
style?: React.CSSProperties;
width?: number;
}
```

### Props

Expand All @@ -38,29 +51,37 @@ correctionLevel: 'L' | 'M' | 'H';
The error correction level for the QR code. Higher levels offer more resilience at the cost of reduced storage capacity. The available levels are 'L' (low), 'M' (medium), and 'H' (high).

```ts
size: number;
height?: number;
```

The size of the QR code in pixels. This size will apply to both width and height unless overridden by specific `width` or `height` props.
(Optional) The height of the wrapping image in pixels. If not provided, the `size` value will be used.

```ts
width?: number;
size: number;
```

(Optional) The width of the wrapping image in pixels. If not provided, the `size` value will be used.
The size of the QR code in pixels. This size will apply to both width and height unless overridden by specific `width` or `height` props.

```ts
height?: number;
src: string;
```

(Optional) The height of the wrapping image in pixels. If not provided, the `size` value will be used.
The data or URL you want to encode in the QR code. The QR code will be generated dynamically based on this content.

```ts
style?: React.CSSProperties;
```

(Optional) Custom CSS styles to be applied to the QR code image.

::: note
Ensure that the `src` prop contains the data or URL you want to encode in the QR code. The QR code will be generated dynamically based on this content.
```ts
width?: number;
```

(Optional) The width of the wrapping image in pixels. If not provided, the `size` value will be used.

::: tip
This component also expresses all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'img'>`
:::


0 comments on commit 4f0b9b8

Please sign in to comment.