react-bulletproof-button
v1.0.4
Published
React component that creates styled <a> bulletproof email buttons that are compatible with a large list of email clients.
Downloads
626
Maintainers
Readme
react-bulletproof-button
React component that allows you design and create goregous email buttons that are compatible with modern email clients & Outlook 2007+. HTML output is based on Campaign Monitor's "Bulletproof email buttons" concept.
Table of contents
Why Do I Need Bulletproof Buttons?
CSS support for HTML emails differs wildly between email clients, making it difficult to create HTML that will render consistently across a wide range of email clients.
In particular, older Outlook clients (2007/2010/2013) use the Microsoft Word rendering engine which limits HTML emails to a subset of the modern CSS spec.
Bulletproof buttons allow you to design and render gorgeous buttons using progressively enhanced VML and CSS.
Older Outlook clients are supported by the use of VML and conditional rendering via the <!--[if mso]>
conditional and mso-hide: all
CSS attributes.
Screenshots
Default Button style
Button with updated colors and border radius
Install
yarn add react-bulletproof-button
or for npm users:
npm install react-bulletproof-button
Usage
Using react-bulletproof-button is super simple:
- Import
BulletproofButton
. - Use the component in your react app, using the various supported props to customize your email button.
import BulletproofButton from 'react-bulletproof-button';
class App extends React.Component {
render() {
return (
<BulletproofButton backgroundColor="#4285F4"
borderRadius="10"
href="www.google.com"
fontColor="#fff"
text='Go to google' />
);
}
}
API
props
Development
yarn install
yarn start
Test
yarn test
Coverage
This will output coverage stats to the command line and create coverage reports in the /coverage
folder.
yarn coverage
License
react-bulletproof-button is released under the MIT license.