Fund Raising Card
Collect donations from users for campaigns
Use the FundRaisingCard
component to highlight fundraising campaigns and encourage donations or support using call to actions. Use them to promote charity or crowdfunding campaigns or to display donation metrics. The can help increase user engagement and improve transparency.
FundRaisingCard
component to collect donations from users for a campaign. FundRaisingCard
component to collect donations from users for a campaign. The FundRaisingCard
component has three mandatory props:
progress
: The current progress of the fund raising.goal
: The total amount to reach.title
: A title for the fund raising campaign.
The progress bar is automatically created using the progress
and goal
props. The rest of the props from the above example are optional:
additionalLabel
: Sets additional text above the progress bar.progressBar
: Customizes the appearance of the progress bar. You can use any value from theProgressProps
type. Please read the documentation of theProgress
component for a full list of available options.buttons
: Pass an array ofButtonProps
object to add buttons at the bottom of your fund raising card. Read the API documentation of theButton
component for available options.img
: Sets an optional image for the card. You can set thelazy
property totrue
in this object to lazy-load the image.
Inside the component, you can pass any other element to build the body of the card.
Cards
The FundRaisingCard
component extends the Card
component, meaning you can further customize its appearance with any valid CardProps
value. Here are some other examples with different styles using card configurations:
FundRaisingCard
component to collect donations from users for a campaign. FundRaisingCard
component to collect donations from users for a campaign. Labels
To customize the label, you can use the progressLabel
prop on the card which supports placeholders for the progress
and goal
props using the {0}
and {1}
syntax respectively. Take the following as an example:
progressLabel
prop. progressLabel
prop. Progress
The progressbar itself can also be customized using the progressBar
prop. Read the documentation of the Progress
component to see all available options for this prop.
API
Card
component for the CardProps
type, and consult the documentation of the Button
and Progress
components for the ButtonProps
and ProgressProps
types. Prop | Purpose |
---|---|
img | Specifies a image for the card. |
img.url | 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 lazy load the image. |
progress | Sets the progress of the fund raising. |
goal | Sets the goal of the fund raising. |
progressLabel | Sets a custom text for the progress label. You can use the {0} and {1} placeholders. |
additionalLabel | Sets additional labels above the progress bar. |
title | Sets the title of the fund raising card. |
buttons | Sets CTA buttons at the bottom of the card. |
buttons.text | Sets the label for the CTA. |
buttons.icon | Sets an icon for the CTA. You can pass SVG strings, or an icon type for Astro components. |
className | Pass additional CSS classes for the card. |