Public
Edited
Feb 14, 2023
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
buttonCTA = (text, url, backgroundColor = "#5362a1", textColor = "#ffffff") => {
return html`
<a href="${url}" class="button-cta" style="background: ${backgroundColor}; color: ${textColor};">${text}</a>
<style>
a.button-cta {
border-radius: 4px;
display: inline-block;
font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
font-size: 14px;
font-weight: 600;
line-height: 24px;
padding: 8px 32px;
}
a.button-cta:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
text-decoration: none;
transform: translateY(-1px);
}
</style>
`;
}
Insert cell
Insert cell
buttonCTA("Button text", "https://observablehq.com/", "#4269D0") // ui blue
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more