Files
ui/apps/ui.hanzo.ai/examples/qr-code.tsx
zeekayandHanzo Dev bf9fbd156f Document the whole library from its own source
The docs site renders every component the barrel names, the gallery
harvests rules for all of them, and the pages come from the packages
rather than a hand-kept copy.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-07 18:59:54 -07:00

40 lines
1.2 KiB
TypeScript

import { XStack, YStack, SizableText } from '@hanzo/gui'
import { QRCode } from '@hanzo/ui'
/** Default — a QR code for a URL at its default 256px size. */
export function Default() {
return <QRCode value="https://ui.hanzo.ai" />
}
/** Sizes — the same value rendered at three pixel sizes. */
export function Sizes() {
return (
<XStack gap="$4" items="center">
{[96, 160, 224].map((size) => (
<QRCode key={size} value="https://ui.hanzo.ai" size={size} />
))}
</XStack>
)
}
/** Error correction — the same value at each of the four correction levels. */
export function ErrorCorrection() {
return (
<XStack gap="$4" items="center" flexWrap="wrap">
{(['L', 'M', 'Q', 'H'] as const).map((level) => (
<YStack key={level} gap="$2" items="center">
<QRCode value="https://ui.hanzo.ai" size={120} level={level} />
<SizableText size="$2" color="$quiet">
{level}
</SizableText>
</YStack>
))}
</XStack>
)
}
/** Colors and margin — custom foreground/background with a quiet-zone margin. */
export function Styled() {
return <QRCode value="https://ui.hanzo.ai" fgColor="#7000FF" bgColor="#F4EEFF" includeMargin size={200} />
}