Butan
Deprecated. The v1 Button component. Please upgrade to the new Button component.
WARNING
This component is DEPRECATED and serves as a fallback for folks still wanting to use the v1 Button component. Please upgrade your templates to use the v2 Button. Butan
will be removed in a future release.
TIP
Semantics: Quite often in the email world we talk about buttons when we actually mean links. Behind the scenes this component is a <a>
element which is styled like a <button>
element.
Install
Install the component from your command line
pnpm add jsx-email
pnpm add jsx-email
bun add jsx-email
bun add jsx-email
npm add jsx-email
npm add jsx-email
yarn add jsx-email
yarn add jsx-email
Usage
Add the component to your email template. Include styles where needed.
import { Butan } from 'jsx-email';
const Email = () => {
return (
<Butan href="https://example.com" style={{ color: '#61dafb', padding: '10px 20px' }}>
Click me
</Butan>
);
};
import { Butan } from 'jsx-email';
const Email = () => {
return (
<Butan href="https://example.com" style={{ color: '#61dafb', padding: '10px 20px' }}>
Click me
</Butan>
);
};
Component Props
href: string;
href: string;
The url to navigate to when the button is clicked.
target?: string;
target?: string;
Specifies the value of the "target"
attribute for the button target
.
TIP
This component also expresses all of the Common Component Props for ComponentProps<'a'>
.