Prerequisites
Before using the Goal Bar Widget, make sure you’ve installed the Widgets library.Quick Setup
The fastest way to add a goal bar widget is through the Givebutter Dashboard:- Visit your Givebutter Dashboard
- Select your campaign and navigate to Sharing > Widgets
- Choose Goal Bar as the widget type and customize the appearance
- Copy the generated code and paste it on your site
Manual Setup
For full control without using the dashboard, create goal bars directly with the<givebutter-goal-bar> tag:
Configuration Options
Customize your goal bar’s appearance by adding attributes to the<givebutter-goal-bar> element:
Required Attributes
| Attribute | Description | Example |
|---|---|---|
campaign | Your campaign code (from your dashboard) | my-campaign |
Styling Attributes
| Attribute | Description | Default | Type |
|---|---|---|---|
progress-bar-color | Color of the progress bar fill | green | Hex Color Code |
background-color | Background color of the container | #FFFFFF | Hex Color Code |
text-color | Color of text labels | #000000 | Hex Color Code |
border-color | Border color of the container | None | Hex Color Code |
border-width | Border width in pixels | 1 | Number |
border-radius | Corner roundness in pixels | 0 | Number |
padding | Inner padding in pixels | 16 | Number |
size | Height of the progress bar | md | sm, md, lg |
max-width | Maximum width of the widget | 100% | CSS value |
show-amount-raised | Show the amount raised | true | Boolean |
show-raised-percentage | Show the percentage complete | true | Boolean |
show-goal-amount | Show the goal amount | true | Boolean |
type | Style of the goal display | progress-bar | progress-bar, thermometer |
Examples
- Default Style
- Brand Colors
- Minimal
- Large
- Thermometer
Troubleshooting
Goal bar shows $0 or 0%
Goal bar shows $0 or 0%
Common causes:
- Campaign hasn’t received any donations yet
- Campaign goal not set in Dashboard
- Campaign is not published/active
- Incorrect campaign code
Goal bar doesn't fit container
Goal bar doesn't fit container
The goal bar is responsive and will fill its container width. If it appears too wide or narrow:
- Wrap it in a container with max-width
- Use CSS to control the parent element’s width
- Check for conflicting CSS styles