How tokkozhin/react-native-qrcode-styled works
This is a React Native QR-code rendering library. The main workflow accepts QR content and encoding options, creates a bit matrix, then renders styled SVG pieces, optional eyes, gradients, backgrounds, and a logo. The graph reflects the sampled runtime modules and README capabilities; some helper behavior and the radial-gradient implementation were not fully sampled, so uncertain internal links are omitted.
Main entry points: SVGQRCodeStyled.tsx Styled QR renderer · SVGPieces.tsx Piece and eye renderer · qrcode.ts QR encoder adapter · SVGGradient.tsx Gradient selector
Components 16
QR encoding
- QR data hook
src/hooks/useQRCodeData.ts - QR encoder adapter
src/adapters/qrcode.ts
QR rendering
- Styled QR renderer
src/components/SVGQRCodeStyled.tsx - Piece and eye renderer
src/components/SVGPieces.tsx - Path and matrix helpers
src/helpers.ts - QR constants
src/constants.ts
Visual styling
- Gradient selector
src/components/SVGGradient.tsx - Linear gradient
src/components/SVGLinearGradient.tsx - Radial gradient
src/components/SVGRadialGradient.tsx
Logo overlay
- Logo SVG overlay
src/components/SVGQRLogo.tsx - Logo sizing hook
src/hooks/useQRCodeLogoSize.ts
Other components
- Library consumer
- Public API
src/index.ts - react-native-svg
- qrcode package
- React Native image sizing
Connections 19
- Library consumer → Public API: imports
README.md - Public API → Styled QR renderer: exports
src/index.ts - Styled QR renderer → QR data hook: requests matrix
src/components/SVGQRCodeStyled.tsx - QR data hook → QR encoder adapter: creates QR
src/hooks/useQRCodeData.ts - QR encoder adapter → qrcode package: encodes data
src/adapters/qrcode.ts - QR encoder adapter → Path and matrix helpers: transforms bits
src/adapters/qrcode.ts - Styled QR renderer → Piece and eye renderer: renders pieces
src/components/SVGQRCodeStyled.tsx - Piece and eye renderer → Path and matrix helpers: builds paths
src/components/SVGPieces.tsx - Piece and eye renderer → QR constants: uses eye sizes
src/components/SVGPieces.tsx - Styled QR renderer → Gradient selector: renders gradients
src/components/SVGQRCodeStyled.tsx - Gradient selector → Linear gradient: selects linear
src/components/SVGGradient.tsx - Gradient selector → Radial gradient: selects radial
src/components/SVGGradient.tsx - Styled QR renderer → Logo SVG overlay: renders logo
src/components/SVGQRCodeStyled.tsx - Logo SVG overlay → Logo sizing hook: calculates size
src/components/SVGQRLogo.tsx - Logo sizing hook → React Native image sizing: gets dimensions
src/hooks/useQRCodeLogoSize.ts - Styled QR renderer → react-native-svg: composes SVG
src/components/SVGQRCodeStyled.tsx - Piece and eye renderer → react-native-svg: draws paths
src/components/SVGPieces.tsx - Logo SVG overlay → react-native-svg: draws image
src/components/SVGQRLogo.tsx - Linear gradient → react-native-svg: defines gradient
src/components/SVGLinearGradient.tsx