Card with CTA
Combine your cards with a clear call to action
Use the CardwithCta
component to create cards with a clear CTA to encourage user engagement. Use them to promote your products, services, or features with a “Learn More” or “Buy Now” button, encourage sign-ups for newsletters, or drive engagement with content.
Card with CTA
Card with CTA with only the required props
including a title, and a CTA button.
including a title, and a CTA button.
The card must be created with the following two required props:
title
: Sets a title for the card.button
: Sets a CTA button for the card. It can accept any validButtonProps
types.
The component can also be created with optional subtitles, using the subTitle
prop:
Card with CTA With additional subtitle
Card with CTA with both titles, CTA, and short description.
Cards with Images
You can use the img
prop to create cards with featured images:
Card with CTA Including subtitle
Component with all possible props.
You can specify the following properties on the image object:
src
: Sets the path to the image.alt
: Sets an alternate text for the image.width
andheight
: Sets the width and height of the image.lazy
: Optionally, set thelazy
property totrue
to lazy-load the image.
API
Please see the documentation of the
Card
component for the CardProps
type, and consult the documentation of the Button
component for the ButtonProps
type. Prop | Purpose |
---|---|
title | Sets the title of the card. |
subTitle | Sets the subtitle of the card. |
className | Pass additional CSS classes for the card. |
bodyClassName | Pass additional CSS classes for the body of the card. |
img | Sets an image for the card. |
img.src | Sets the path for the image. |
img.alt | Sets an alternate text for the image. |
img.width | Sets the width of the image. |
img.height | Sets the height of the image. |
img.lazy | Set to true to enable lazy loading for the image. |
button | Sets the CTA for the card. |
button.text | Sets the text of the CTA. |
button.icon | Sets an icon for the CTA. You can pass SVG strings, or an icon type for Astro components. |
Request improvement for this page