Cards are used to display content in a list-like format. They are often used to display a collection of items, such as blog posts, products, or other types of content.
Lorem ipsum dolor sit amet
Cillum dolor nisi et sunt in in et ullamco eiusmod duis aute et fugiat excepteur. Sit irure consectetur anim do aliqua excepteur amet nulla magna enim proident incididunt ipsum.
This component is based on the <article> element and can take in any additional HTML attributes. The following are the custom props that can be passed to the component.
Prop
Type
Default
align
The alignment of the content inside the card.
"left" | "center"
"left"
Examples
Centered
Lorem ipsum dolor sit amet
Cillum dolor nisi et sunt in in et ullamco eiusmod duis aute et fugiat excepteur. Sit irure consectetur anim do aliqua excepteur amet nulla magna enim proident incididunt ipsum.
Depending on the framework, it’s sometimes beneficial to use a component for generating the Card. In this case, we have put together the following Astro component to serve as a blueprint for how you could possibly set up a Card component, and what properties to consider.