nmamali / expo-barcode-generator

A React Native barcode generator compatible with Expo
MIT License
5 stars 3 forks source link

Need a way to pass style to svg #7

Open AlexSapoznikov opened 6 months ago

AlexSapoznikov commented 6 months ago

Currently I am unable to set for example max width to the generated svg element as I can not pass style to it. Please make it possible.

JPStrydom commented 2 months ago

@AlexSapoznikov are you envisioning passing a style prop to Barcode, where that style is then passed through to the top level SVG component?

What's tricky about that is that fixed dimensions are user to generate the barcode. You can pass in some basic options if you look at the Options section in the README such as width and height. As such, it's tricky to make these barcode responsive as it'll have to recalculate the barcode one every resize.

You could perhaps try to play around with the options to see if that accomplishes what you need? Perhaps passing in a responsive value to height and/or width might work?