C

QrcodeDisplay 二维码展示

数据展示

二维码展示 — Chaos UI 的数据展示。

何时使用

需要二维码展示功能时使用本组件。

代码示例

基础用法

tsx
import { QRCodeDisplay } from "@/components/ui/qrcode-display"

export function Basic() {
return <QRCodeDisplay />
}

API / Props

QRCodeDisplay

PropTypeDefault说明
classNamestring自定义样式类名
valuestringText to encode in QR code
sizenumber200Size in pixels
fgColorstring#000000Foreground color
bgColorstring#ffffffBackground color
level"L" | "M" | "Q" | "H"MError correction level
includeMarginbooleantrueInclude margin/padding
...restReact.ComponentProps<"div">透传 <div> 原生属性

注意事项

  • Client Component: 使用 "use client",依赖 React hooks/状态,需在客户端渲染。
  • 原生属性: 继承所有 <div> 原生 HTML 属性。

📘 完整交互式示例与控件属性请查看 Storybook 文档