Blog Card
Present blog posts or articles in a compact, visually appealing format
Use the BlogCard
component to create content previews and increase engagement. The BlogCard
component can be used to summarize and highlight key details of an article, such as its title, featured image and snippet, giving users a quick overview before navigating.
HTML
code. Use the text field to provide preview and additional context about the linked page.This will create a secondary
blog card. Each card must have an href
attribute that points to a page. How the link is opened can be configured using the target
prop. To add an image for your BlogCard
, specify an img
prop object with the following properties:
src
: Sets the url for your image.alt
: Sets an alternate text for your image.width
: Sets the width of your image.height
: Sets the height of your image.lazy
: Image objects can also have an optionallazy
property. Setlazy
totrue
to lazy load the image.
Different Layouts
The above example shows a BlogCard
component with a secondary
layout. You can create different layout by omitting this prop. The title
and text
props are also optional, making it possible to create blog cards with a featured image only. This can be useful for links where the image already includes the title of the article, and you don’t want to provide any snippet.
API
Prop | Purpose |
---|---|
href | Sets the link for the card. |
target | Sets the target of the link. |
img | Sets the featured image. To lazy load the image, set the img.lazy property to true . |
title | Sets the title of the card. |
text | Sets the text of the card. |
secondary | Sets a secondary layout for the card, where the image and text are aligned side by side. |
className | Pass additional CSS classes for your BlogCard component. |
Request improvement for this page