React QR Code is a component enabling developers to generate QR codes directly in React applications. QR codes are two-dimensional barcodes storing various data types, including URLs, text, or contact information. React-qr-code package simplifies the integration of QR codes into React projects. Customization options in the react-qr-code component includes adjusting the size, color, and error correction level, and it enhances the visual appeal and functionality of web applications.
QR Codes and React: A Match Made in Digital Heaven!
What’s a QR Code, Anyway?
Alright, picture this: it’s the mid-90s, and some clever folks at Denso Wave, a Toyota subsidiary, are scratching their heads, trying to figure out a better way to track vehicles and components during manufacturing. Then, BAM! The Quick Response code, or QR code, is born. Think of it as the barcode’s cooler, more versatile cousin. Instead of just a one-dimensional line, it’s a snazzy square that can hold tons of information, and you can scan it with your phone!
It was originally designed for industrial use, but fast forward to today, and QR codes are everywhere. From discount coupons to contactless payments, these little squares have become an essential part of our daily lives. It’s like a secret handshake for the digital age.
React: The King of Modern Web Dev
Now, let’s talk about React. Imagine you’re building a house. You wouldn’t just throw bricks together randomly, right? You’d use a blueprint, break it down into rooms, and assemble it piece by piece. That’s kind of what React does for web development.
React is a JavaScript library for building user interfaces (UIs). It allows developers to create reusable UI components, making web development more efficient and maintainable. Think of it as the LEGO bricks of the web. You can build complex interfaces by composing smaller, independent components.
React has become super popular because it’s fast, flexible, and makes building complex UIs a whole lot easier. Plus, it’s backed by Facebook (or Meta, if you’re keeping up), so you know it’s got some serious muscle behind it.
Why React and QR Codes? A Perfect Pairing
So, why combine these two powerhouses? Well, let’s break it down. React’s component-based architecture makes it perfect for generating and displaying QR codes:
- Reusability: You can create a QR code component once and reuse it throughout your application. Need a QR code for a product page? Boom! Need one for an event ticket? Done!
- Flexibility: React allows you to easily customize the appearance and functionality of your QR codes. Change the size, color, or error correction level with just a few lines of code.
- Dynamic Updates: React’s state management makes it a breeze to create dynamic QR codes that update in real-time. Imagine a QR code that changes based on user input or server data. Mind-blowing, right?
Basically, React turns QR code generation into a breeze. No more wrestling with complex libraries or messy code. It’s clean, efficient, and dare I say, fun?
QR Code Use Cases: Unleash Your Creativity
Okay, so you’re probably thinking, “This is cool, but what can I actually do with it?” Well, buckle up, because the possibilities are endless!
- Marketing Campaigns: Slap a QR code on your print ads, posters, or even your product packaging. When scanned, it can take users directly to your website, a promotional landing page, or even a social media contest.
- Event Ticketing: Say goodbye to paper tickets! Generate unique QR codes for each attendee and scan them at the entrance. It’s faster, more secure, and eco-friendly.
- Contact Sharing: Share your contact information with a single scan. Encode your vCard data into a QR code and let others add you to their contacts instantly.
- Wi-Fi Access: Let your guests connect to your Wi-Fi without typing in a long, complicated password. Encode your network name and password into a QR code and let them scan away!
- Restaurant Menus: In the age of contactless solutions, using QR codes for menus is a game-changer. Update menus in real-time and keep your customers safe and informed.
- Payment Systems: Integrate QR codes into your payment system to enable quick and easy transactions. Customers can scan the code with their phone and pay directly from their bank account or credit card.
- Product Authentication: Add QR codes to your products to allow customers to verify their authenticity. This can help prevent counterfeiting and protect your brand.
These are just a few examples, but the truth is, the only limit is your imagination. So, get creative and think of how you can use QR codes and React to enhance your projects and make your users’ lives easier.
Understanding the Core Technologies: Let’s Get Technical (But Not Too Technical!)
Alright, buckle up, buttercups! Before we start slinging code and making QR codes dance, let’s get a handle on the core tech. Think of it as learning the rules of the game before you start playing – nobody wants to be that person who doesn’t know what’s going on.
React Fundamentals: Building Blocks of Awesomeness
React, at its heart, is all about components. These are like Lego bricks for your website – small, reusable pieces that you can combine to build bigger, more complex things. Imagine a button, a text box, or even a whole navigation bar – those are all components!
Now, how do these components talk to each other? That’s where props come in. Think of props as giving instructions to your Lego brick. For example, if you have a QR code component, you’d use props to tell it what data to encode, like a website URL or your grandma’s secret recipe. Props are the data you send into a component to customize it. For example, you can pass a value that you wish to encode to a component in order to display it for your viewers.
Sometimes, a component needs to remember things itself. That’s where state comes in. State is like the component’s own little memory. If you’re building a dynamic QR code that changes based on user input, state is what you’d use to keep track of that input and trigger a re-render of the QR code.
Finally, we have JSX, which might sound like some fancy alien language, but it is essentially just a way to write HTML-like code inside your JavaScript. It makes it way easier to build user interfaces in React, allowing you to describe what you want the UI to look like, and React takes care of making it happen. It’s like telling a robot what to build instead of manually assembling each brick yourself.
QR Code Technology Deep Dive: More Than Just Squares
Okay, so you see those quirky little squares everywhere, but what exactly are they? A QR code isn’t just random noise; it’s a carefully structured matrix of modules. You’ve got your finder patterns (those squares in the corners that help scanners orient themselves), alignment patterns (for larger codes), and all those little black and white squares that actually encode your data.
The encoding process itself is quite clever. Your data (text, URLs, whatever) gets converted into a specific format and then arranged within the QR code’s matrix.
And here’s a fun fact: QR codes have error correction levels. This means they can still be read even if they’re partially damaged or obscured. The higher the error correction, the more damage a QR code can withstand. It’s like giving your QR code a little superhero shield.
What kind of stuff can you cram into these squares? Pretty much anything! You can encode:
- URLs (linking to websites)
- Text (sharing messages)
- Contact information (vCards/MeCards)
- Wi-Fi passwords
- …and more!
Image Formats: SVG vs. the World
When you create a QR code, you need to save it as an image. You’ve got a few options here, but SVG (Scalable Vector Graphics) is generally the king.
Why SVG? Because it’s scalable. You can blow it up to billboard size or shrink it down to a postage stamp, and it’ll still look crisp and clear. It’s also resolution independent, meaning it doesn’t rely on pixels like other image formats. This makes SVG QR codes perfect for printing and displaying on different devices.
Package Management with NPM/Yarn/pnpm: Your Toolkit for the Web
To make your life easier, you’ll want to use a package manager like NPM, Yarn, or pnpm. These tools let you easily install and manage React QR code libraries (we’ll get to those later).
Think of them as app stores for developers. You can search for libraries, install them with a single command, and keep them updated with ease.
Here are some basic commands you’ll need:
npm install [package-name]
(oryarn add [package-name]
, orpnpm add [package-name]
) – Installs a package.npm uninstall [package-name]
(oryarn remove [package-name]
, orpnpm remove [package-name]
) – Uninstalls a package.
With these technologies under your belt, you’re ready to start building some seriously awesome QR codes in React.
Top React QR Code Libraries: A Comparative Overview
Alright, buckle up, because we’re diving headfirst into the wild world of React QR code libraries! If you’re like me, you probably want to whip up some QR codes in your React app without reinventing the wheel. Lucky for us, there’s a whole bunch of awesome libraries out there ready to save the day. Let’s check out the top contenders, put ’em head-to-head, and see which one tickles your fancy. We’ll look at ease of use, customization options, and some practical examples to get you coding in no time.
qrcode.react
-
What’s the Hype?
qrcode.react
is like the OG of React QR code libraries. It’s super straightforward and gets the job done without any fuss. Think of it as the reliable friend you can always count on. -
Installation Time! Getting this bad boy into your project is a breeze. Just fire up your terminal and run one of these commands:
npm install qrcode.react # or yarn add qrcode.react # or pnpm add qrcode.react
-
Basic Usage – Keepin’ It Simple: Here’s how you can get a QR code popping up on your screen in no time:
import React from 'react'; import QRCode from 'qrcode.react'; function MyComponent() { const value = 'https://www.example.com'; return ( <QRCode value={value} /> ); } export default MyComponent;
See? Easy peasy. Just import the component, pass in the
value
prop, and bam – you’ve got a QR code. -
Customization Station: Want to tweak things a bit? No problem!
qrcode.react
lets you play around with the size, color, and error correction level:<QRCode value="https://www.example.com" size={256} fgColor="#228B22" /* Forest Green */ level="H" />
Here, we’ve set the size to 256 pixels, the color to a cool forest green, and the error correction level to “H” (High), making the QR code extra resilient. Play around with these options to make your QR code unique.
react-qr-code
-
A Fresh Contender:
react-qr-code
is another fantastic option that’s been gaining popularity. It’s designed with modern React practices in mind and offers a clean, flexible API. -
Installation – The Usual Suspects: Just like before, installing
react-qr-code
is a piece of cake:npm install react-qr-code # or yarn add react-qr-code # or pnpm add react-qr-code
-
Basic Usage – A Tad More Polished: Here’s a simple example to get you started:
import React from 'react'; import QRCode from 'react-qr-code'; function MyComponent() { const value = 'https://www.example.com'; return ( <QRCode value={value} /> ); } export default MyComponent;
-
Customization – Get Your Creative Juices Flowing:
react-qr-code
comes with a solid set of customization options. You can tweak the size, colors, and even add a title attribute for better accessibility:<QRCode value="https://www.example.com" size={256} level="H" bgColor="#F0F8FF" /* AliceBlue */ fgColor="#8B008B" /* DarkMagenta */ title="QR Code for Example.com" />
This code sets the size, error correction level, background color, foreground color, and adds a descriptive title.
qrcode-generator
-
The Low-Level Hero:
qrcode-generator
is a bit different. It’s a more low-level library that focuses on generating the raw QR code data. This means you have more control, but it also requires a bit more work to integrate into a React component. -
Installation: You guessed it – another simple installation:
npm install qrcode-generator # or yarn add qrcode-generator # or pnpm add qrcode-generator
-
Integration with React: To use
qrcode-generator
with React, you’ll need to create a component that uses the library to generate the QR code data and then renders it using an<img>
tag or a<canvas>
element. Here’s a basic example:import React, { useRef, useEffect } from 'react'; import QRCode from 'qrcode-generator'; function MyQRCode({ value, size = 256 }) { const canvasRef = useRef(null); useEffect(() => { const canvas = canvasRef.current; if (!canvas) return; const qr = QRCode(0, 'L'); qr.addData(value); qr.make(); const ctx = canvas.getContext('2d'); if (!ctx) return; const tileW = size / qr.getModuleCount(); const tileH = size / qr.getModuleCount(); for (let row = 0; row < qr.getModuleCount(); row++) { for (let col = 0; col < qr.getModuleCount(); col++) { if (qr.isDark(row, col)) { ctx.fillStyle = '#000000'; } else { ctx.fillStyle = '#FFFFFF'; } ctx.fillRect(col * tileW, row * tileH, tileW, tileH); } } }, [value, size]); return <canvas ref={canvasRef} width={size} height={size} />; } export default MyQRCode;
-
Use Cases and Examples:
qrcode-generator
is perfect for when you need fine-grained control over the QR code generation process. For instance, you might use it to generate QR codes on the server-side or to integrate with custom rendering pipelines. Because it offers more customization than other solutions.
So, there you have it! Three awesome React QR code libraries, each with its own strengths and quirks. Whether you want a simple and straightforward solution, a modern and flexible option, or a low-level tool for maximum control, there’s a library out there for you. Happy coding!
Creating a Basic QR Code Component
Alright, let’s roll up our sleeves and dive into building a basic QR code component in React. Think of it like building with LEGOs, but instead of colorful bricks, we’re using lines of code to create something functional and cool – a QR code!
First things first, we need to set up our React component. This is where the magic happens. Create a new file (e.g., QRCodeComponent.js
) and import React. Inside, you’ll define a functional component (or a class component, if you’re feeling old-school).
Now, here’s where _props_
come in. Props are like the ingredients you pass to a recipe. In our case, we’re passing the data we want to encode into the QR code. For instance, if you want to create a QR code that leads to your website, you’ll pass the URL as a prop.
import React from 'react';
import QRCode from 'qrcode.react'; // Or any other QR code library
const QRCodeComponent = (props) => {
const { value } = props;
return (
<div>
<QRCode value={value} size={256} />
</div>
);
};
export default QRCodeComponent;
See that? We’re using a <QRCode>
component (from a library like qrcode.react
) and passing our value
prop to it. The size
prop is just to make sure our QR code is visible.
To use this component, you’d import it into your main app and pass the URL (or any data) like this:
import QRCodeComponent from './QRCodeComponent';
function App() {
return (
<div>
<h1>My QR Code Generator</h1>
<QRCodeComponent value="https://www.example.com" />
</div>
);
}
export default App;
Boom! You should see a QR code on your page that, when scanned, takes you to example.com. Easy peasy, lemon squeezy!
Customizing the QR Code Appearance
Okay, so you’ve got a basic QR code. Great! But what if you want to jazz it up a bit? Make it pop, you know? Let’s talk about customization.
-
Size: The
size
prop, as you saw earlier, controls how big the QR code is. Play around with different values to get the perfect size for your needs. -
Color and BackgroundColor: Want to change the colors? Most libraries allow you to customize the foreground and background colors.
<QRCode value="https://www.example.com" size={256} fgColor="#000000" bgColor="#FFFFFF" />
In this example, fgColor
is the color of the QR code itself, and bgColor
is the background color.
- Error Correction Level: This is crucial for making sure your QR code is readable even if it’s a bit damaged or obscured. Common levels are L (Low), M (Medium), Q (Quartile), and H (High). Higher levels can handle more errors but result in a more complex QR code.
<QRCode value="https://www.example.com" size={256} level="H" />
- Quiet Zone: This is the white space around the QR code. It’s important because it helps scanners recognize the QR code. You can often adjust this, although it might be handled automatically by the library.
Here’s a complete example incorporating all these customizations:
import React from 'react';
import QRCode from 'qrcode.react';
const QRCodeComponent = (props) => {
const { value, size, fgColor, bgColor, level } = props;
return (
<div>
<QRCode
value={value}
size={size}
fgColor={fgColor}
bgColor={bgColor}
level={level}
/>
</div>
);
};
QRCodeComponent.defaultProps = {
size: 256,
fgColor: '#000000',
bgColor: '#FFFFFF',
level: 'H',
};
export default QRCodeComponent;
You can then call it like this:
<QRCodeComponent
value="https://www.example.com"
size={300}
fgColor="#3498db"
bgColor="#ecf0f1"
level="Q"
/>
Remember to check the documentation of your chosen library for all available customization options.
Direct Rendering with the Canvas API
Feeling adventurous? Want to go au naturel and generate QR codes directly using the Canvas API? It’s a bit more involved but gives you ultimate control.
The basic idea is to use a library (or write your own) to generate the QR code data, then use the Canvas API to draw the QR code onto a <canvas>
element.
Advantages:
- Full Control: You have complete control over every pixel.
- No Dependencies: If you write your own QR code generation logic, you don’t need external libraries (though it’s often easier to use one).
Disadvantages:
- Complexity: It’s more complex than using a library.
- More Code: You’ll write more code, and potentially more buggy code.
Here’s a basic example:
import React, { useRef, useEffect } from 'react';
import QRCode from 'qrcode'; // Using qrcode library for data generation
const CanvasQRCode = ({ value, size }) => {
const canvasRef = useRef(null);
useEffect(() => {
QRCode.toCanvas(canvasRef.current, value, { width: size }, (error) => {
if (error) console.error(error);
console.log('success!');
});
}, [value, size]);
return <canvas ref={canvasRef} width={size} height={size} />;
};
export default CanvasQRCode;
In this example, we’re using the qrcode
library (different from qrcode.react
) to generate the QR code data. We then use the toCanvas
method to draw the QR code onto the canvas.
Pro-Tip: This approach is often used for more advanced scenarios, like adding logos in the center of the QR code or creating unique visual styles.
And there you have it! You’ve gone from zero to QR code hero in just a few steps. Now go forth and encode all the things! Just remember, with great power comes great responsibility… and maybe a few debugging sessions. Have fun!
Advanced Features and Use Cases: Unleashing the Power of QR Codes
Alright, buckle up buttercups! We’ve mastered the basics; now, let’s transform our QR codes from simple squares into digital Swiss Army knives. We’re talking about unlocking the real potential of these little matrix barcodes by diving into advanced functionalities and real-world applications. Ready to make some magic happen?
URL Encoding: Linking to Websites
So, you want your QR code to whisk someone away to your amazing website? Easy peasy! URL encoding is the name of the game. You’re essentially stuffing a website address into the QR code.
Use Cases:
- Marketing Campaigns: Imagine sticking a QR code on a poster that instantly takes people to a signup page for your newsletter or a special offer. Talk about instant engagement!
- Product Pages: Slap a QR code on your product packaging that directs consumers straight to the product’s webpage, complete with specs, reviews, and a big, shiny “Add to Cart” button.
-
Example Code:
import QRCode from 'qrcode.react'; const MyComponent = () => { const url = "https://www.example.com/your-amazing-page"; return ( <QRCode value={url} size={256} level="H" /> ); } export default MyComponent;
Data Encoding: Storing Information
Want to cram more than just a web link into your QR code? No problem! Data encoding lets you store all sorts of information like plain text, contact details, or even Wi-Fi passwords. Think of it as a secret message hidden in a square!
Use Cases:
- Sharing Contact Information: Forget scribbling your number on a napkin. A QR code containing your contact info makes sharing effortless.
- Wi-Fi Passwords: Let your guests connect to your Wi-Fi with a quick scan. No more fumbling with long, complicated passwords!
-
Example Code:
import QRCode from 'qrcode.react'; const MyComponent = () => { const data = "This is the information that I want to show!"; return ( <QRCode value={data} size={256} level="H" /> ); } export default MyComponent;
VCard/MeCard: Sharing Contact Information
Okay, so we touched on contact information, but vCard and MeCard formats deserve their own spotlight. These are standardized ways to encode a whole bunch of contact details (name, phone number, email, address, the works!) into a QR code. It’s like a digital business card.
Example Code:
import QRCode from 'qrcode.react';
const MyComponent = () => {
const vCardData = `BEGIN:VCARD
VERSION:3.0
N:Lastname;Firstname;;;
FN:Firstname Lastname
ORG:Company Name
TEL;TYPE=work,VOICE:123-456-7890
EMAIL:[email protected]
END:VCARD`;
return (
<QRCode value={vCardData} size={256} level="H" />
);
}
export default MyComponent;
Dynamic QR Codes: Conditional Redirection
This is where things get really interesting. Dynamic QR codes can change their destination based on certain conditions. Imagine a single QR code that redirects users to different landing pages depending on the time of day or their location. Mind. Blown.
Use Cases and Implementation Strategies:
- A/B Testing: Use a dynamic QR code to send users to different versions of your landing page to see which one performs better.
- Time-Sensitive Offers: Redirect users to a limited-time offer page during specific hours, and to a general information page outside those hours.
- Location-Based Content: Show different content based on where the user is scanning from.
Dynamic QR codes typically require a backend service to manage the redirection logic. When the QR code is scanned, it points to a short URL managed by your service, which then decides where to redirect the user based on predefined rules. You might use a database to store these rules and track scan data. Services like Bitly or dedicated dynamic QR code platforms can also handle this for you.
Customization: Branding and Aesthetics
Who says QR codes have to be boring? Let’s jazz them up! Adding your logo and playing with colors can transform your QR code from a generic square into a branded masterpiece.
Tips for Designing Visually Appealing QR Codes:
- Incorporate Your Logo: Place your logo in the center of the QR code. Make sure it doesn’t cover too much of the code, or it might not scan properly.
- Use Brand Colors: Use your brand colors for the QR code’s foreground and background. Just make sure there’s enough contrast for easy scanning.
- Subtle Shapes: Instead of sharp squares, experiment with rounded corners or other subtle shapes to make your QR code stand out.
- Test, Test, Test: Always test your customized QR codes with multiple scanners and devices to ensure they work reliably.
With a little creativity, you can create QR codes that are not only functional but also visually appealing and perfectly aligned with your brand. Go forth and create some QR code art!
Production Considerations: Ensuring Reliability and Performance
Alright, you’ve built a killer QR code component in React. High fives all around! But before you unleash it upon the unsuspecting public, let’s talk about making sure it actually works in the real world. We’re talking about those nitty-gritty production considerations that separate a cool project from a reliable one.
Performance Optimization: Don’t Be Slow!
Nobody likes a slow website, and that includes slow QR codes. If generating QR codes is bogging down your app, let’s look at a few tricks.
- Caching: Think of caching like storing the answers to common questions so you don’t have to recalculate them every time. If you’re generating the same QR code repeatedly (say, for a product page), cache the result! Use React’s
useMemo
hook or a more robust caching solution for complex scenarios. - Code Splitting: Not everyone needs every part of your app all the time. Code splitting lets you break up your JavaScript into smaller chunks that load on demand. This means the initial page load is faster, and your QR code component doesn’t slow things down unnecessarily.
- Web Workers: QR code generation can be computationally intensive. Offload that work to a Web Worker, a separate thread that won’t block the main UI thread. This keeps your app responsive while the QR code is being created.
Cross-Browser Compatibility: The Browser Jungle
Ah, the joys of web development! Ensuring your QR codes play nicely across different browsers is a must.
- Testing, Testing, 1, 2, 3: Fire up your app in Chrome, Firefox, Safari, Edge… the whole gang! Test on both desktop and mobile. You’d be surprised what inconsistencies you might find. Browser developer tools are your friend.
- Polyfills and Transpilation: Modern JavaScript is awesome, but not all browsers are up to speed. Use tools like Babel to transpile your code into a version that older browsers understand. Polyfills can fill in the gaps for missing features.
- CSS Considerations: Ensure your QR code styling is cross-browser compatible. Use vendor prefixes judiciously if needed, and validate your CSS with online tools.
Accessibility: QR Codes for Everyone!
Let’s make sure everyone can use your QR codes, including users with disabilities. Accessibility isn’t just a nice-to-have; it’s the right thing to do.
- Contrast is Key: Make sure there’s sufficient contrast between the QR code and its background. Use tools to check contrast ratios against WCAG guidelines.
- Alternative Text: While a QR code image isn’t really conveyed by alt-text, providing text near the image is. Provide clear and concise alternative text for the image itself to explain what the QR code does. For example: “Scan this code to visit our website.”
- Screen Reader Considerations: Structure your HTML semantically so screen readers can interpret the content correctly. Test with a screen reader to ensure a smooth experience.
Error Handling: What Happens When Things Go Wrong?
Murphy’s Law states, “Anything that can go wrong will go wrong”. Plan for the inevitable.
- Input Validation: Sanitize and validate the data you’re encoding in the QR code. Prevent malicious input from crashing your component or generating invalid QR codes.
- Try-Catch Blocks: Wrap QR code generation code in
try-catch
blocks to handle exceptions gracefully. Display user-friendly error messages instead of crashing the app. - Fallback Mechanisms: If QR code generation fails, provide a fallback mechanism, such as a plain text link or a manual input form.
Here’s an example of basic error handling within React, for a QR component:
import React, { useState } from 'react';
import QRCode from 'qrcode.react';
function MyQRCode({ value }) {
const [error, setError] = useState(null);
try {
return (
<QRCode value={value} size={256} onError={(err) => setError(err.message)}/>
);
} catch (err) {
setError(err.message);
return <p>Error generating QR code: {err.message}</p>;
}
}
export default MyQRCode;
Security Considerations: Don’t Get Hacked!
QR codes can be a security risk if not handled carefully. Protect yourself and your users.
- Sensitive Data: Avoid encoding sensitive data (passwords, API keys, etc.) directly in QR codes.
- URL Redirection: Be cautious when redirecting users to URLs encoded in QR codes. Validate the URL before redirecting to prevent phishing attacks.
- Code Injection: If you’re dynamically generating QR codes based on user input, sanitize that input to prevent code injection vulnerabilities.
Scanning Reliability: Making It Easy to Scan
A QR code that can’t be scanned is about as useful as a chocolate teapot.
- Size Matters: Make sure the QR code is large enough to be easily scanned by mobile devices. A good rule of thumb is at least 1×1 inch (2.5×2.5 cm).
- Contrast, Again: Ensure sufficient contrast between the QR code and its background. Black on white is the classic for a reason!
- Quiet Zone: Maintain a “quiet zone” – a clear margin around the QR code – to help scanners recognize the code. This zone should be at least 4 modules wide.
By addressing these production considerations, you can ensure your React QR code implementation is reliable, performant, accessible, and secure. Now go forth and create awesome QR code experiences!
So, there you have it! Generating QR codes in your React apps doesn’t have to be a headache. With these simple tools and techniques, you can easily add a touch of interactivity and convenience for your users. Now go forth and get coding!