react-qr-reader icon indicating copy to clipboard operation
react-qr-reader copied to clipboard

How to customized the scanner style? such as new border weight or color.

Open hiveryeah opened this issue 5 years ago • 4 comments

Hi JodusNodus,

One improvement suggestion, do you consider some customized methods of QR code reader? Such as the scanner style with new border weight or color; Background image with transparency;

Thank you for your time! Br. Eva

hiveryeah avatar May 09 '19 03:05 hiveryeah

If you mean customizing the view finder there is no official way (for now). A workaround i've been using:

<>
	<QrReader
		delay={300}
		onError={console.error}
		onScan={this.onScan}
		showViewFinder={false}
	/>
	<ViewFinder />
</>

Disable default viewfinder and render my own (with z-index: 1;)

shilangyu avatar Aug 05 '19 14:08 shilangyu

I created my own class name to do this:

// index.css


// We all love border radiuses
.qr-image-wrapper section { 
  border-radius: 16px;                   
}

// To get rid of the default red box-shadow 
.qr-image-wrapper section div {
  box-shadow: unset !important;     
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Then In wherever you are using the QrReader. 
// QrReaderContainer.js

<QrReader className="qr-image-wrapper" />

marxlow avatar Sep 09 '19 09:09 marxlow

@marxlow thank you, i appreciated that

NSNJRGL avatar Sep 13 '19 02:09 NSNJRGL

If you mean customizing the view finder there is no official way (for now). A workaround i've been using:

<>
	<QrReader
		delay={300}
		onError={console.error}
		onScan={this.onScan}
		showViewFinder={false}
	/>
	<ViewFinder />
</>

Disable default viewfinder and render my own (with z-index: 1;)

You rock. Spent ages trying to sort this out!

AvinoamHeroicRealm avatar May 06 '23 15:05 AvinoamHeroicRealm