Mantine QR 代码组件
制造的 外观卡 * 每日刷新
概览
此组件创建于 曼汀语Name 图书馆. 这需要 曼汀 9.x (英语) 财务报告和审定财务报表 反应 19。 。 。 .
这个 曼汀QR 码 组件是一个高度自定义的 QR 代码生成器,用于使用 Maintine 构建的 React 应用程序.
特征
- 🎨 主题集成: 满文主题支持, 所有主题颜色用于前景和背景
- 📐 弹性尺寸: 支持所有曼汀大小( xs- xl) 外加自定义值
- 🔵 点样式:三种数据模块样式-
square, (中文(简体) ),rounded, (中文(简体) ),dots - 🔲 角样式: 有三种寻人图案样式——
square, (中文(简体) ),rounded, (中文(简体) ),dots - 🖼️ 图像重叠: 在中心添加自动模块挖掘的标志或图像
- 🛡️ 错误校正:四级——L级(7%)、M级(15%)、Q级(25%)、H级(30%)
- 📥 下载钩数字 :
useQRCodeDownload要导出为 SVG、 PNG、 JPEG 或 WebP 的钩头 - 🎨 样式 API: 全曼汀样式 API 有8个样式选择器(
root, (中文(简体) ),svg, (中文(简体) ),background, (中文(简体) ),modules, (中文(简体) ),finderPattern, (中文(简体) ),finderOuter, (中文(简体) ),finderInner, (中文(简体) ),image(中文(简体) ) - 📦 类型脚本: 框外的完整类型安全
- ⚡ SSR 兼容性: 工作与 Next.js 服务器侧渲染
[!注]
→ 演示文稿和文件 → Youtube 视频 → 更多曼汀组件
安装
npm install @gfazioli/mantine-qr-code
或者说
yarn add @gfazioli/mantine-qr-code
在应用程序根部安装导入包样式后:
import '@gfazioli/mantine-qr-code/styles.css';
使用量
import { QRCode } from '@gfazioli/mantine-qr-code';
function Demo() {
return <QRCode value="https://mantine.dev" />;
}
自定义样式
<QRCode
value="https://mantine.dev"
size="xl"
color="blue"
dotStyle="rounded"
cornerStyle="rounded"
/>
图像覆盖
<QRCode
value="https://mantine.dev"
size="xl"
image="https://example.com/logo.png"
errorCorrectionLevel="H"
imageSize={0.25}
imagePadding={2}
imageRadius="md"
/>
下载为 SVG/ PNG
import { QRCode, useQRCodeDownload } from '@gfazioli/mantine-qr-code';
function Demo() {
const { ref, download } = useQRCodeDownload({ fileName: 'my-qr-code' });
return (
<>
<QRCode ref={ref} value="https://mantine.dev" />
<button onClick={() => download({ format: 'png' })}>Download PNG</button>
<button onClick={() => download({ format: 'svg' })}>Download SVG</button>
</>
);
}
发起人
你的支持帮助了我:
- 积极维护项目,及时修复错误并更新安全信息
- 添加新特性, 提高性能,并完善开发者的经验
- 扩大测试范围和文件,以更顺利地采用
- 确保长期可持续性而不依赖临时自由时间
- 优先处理最重要的社区请求和路线图项目
开放源码的繁荣,如果受益的人能够回报——即使每月的小额捐款也会产生真正的变化。 赞助有助于覆盖维护时间、基础设施和无数使项目保持健康的无形任务.
你的帮助真的很重要.
💚 成为提案国 今天,帮助我保持这一项目的可靠性,更新,并为每个人成长.