This page demonstrates various ways to embed the Hardcover currently reading widget.
<script src="https://hardcoverembed.gouthamve.dev/static/widget.js"></script>
Simple embed with default settings:
<div data-hardcover-widget data-api-url="${apiUrl}" data-username="your-username"></div>
Widget with custom width and column settings:
<div data-hardcover-widget
data-api-url="${apiUrl}"
data-username="your-username"
data-max-width="500px"
data-min-column-width="100px"
data-gap="0.5rem"></div>
Compact widget suitable for sidebars:
Widget with exactly 4 columns:
<div data-hardcover-widget
data-api-url="${apiUrl}"
data-username="your-username"
data-columns="4"></div>
Hide the attribution link:
<div data-hardcover-widget
data-api-url="${apiUrl}"
data-username="your-username"
data-show-powered-by="false"></div>
Widget with custom CSS styling:
Programmatically initialized widget:
const widget = new HardcoverWidget(
document.getElementById('js-widget'),
{
apiUrl: '${apiUrl}',
username: 'gouthamve',
maxWidth: '400px',
showPoweredBy: true
}
);
Completely isolated iframe embed:
<iframe src="${apiUrl}/static/embed.html?username=your-username"
width="100%" height="300" frameborder="0"></iframe>
Display recently finished books:
<div data-hardcover-widget
data-api-url="${apiUrl}"
data-username="your-username"
data-book-type="last-read"></div>
Show both types of books for the same user: