The Button Widget creates an attractive, clickable button on your website that opens a donation form in a popup modal. It’s perfect for adding donation functionality without disrupting your page layout.Documentation Index
Fetch the complete documentation index at: https://docs.givebutter.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before using the Button Widget, make sure you’ve installed the Widgets library.Quick Setup
The fastest way to add a button widget is through the Givebutter Dashboard:- Visit your Givebutter Dashboard
- Select your campaign and navigate to Sharing > Widgets
- Choose Button 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 buttons directly with the<givebutter-button> tag:
Configuration Options
Customize your button’s appearance by adding attributes to the<givebutter-button> element:
Required Attributes
| Attribute | Description | Example |
|---|---|---|
campaign | Your campaign code (from your dashboard) | my-campaign |
Styling Attributes
| Attribute | Description | Default | Type |
|---|---|---|---|
label | Text displayed on the button | Donate | String |
hide-label | Hide the label text (icon only) | false | Boolean |
label-color | Color of the text and icon | #FFFFFF | Hex Color Code |
background-color | Background color of the button | #3366FF | Hex Color Code |
border-color | Color of the button border | None | Hex Color Code |
border-width | Width of the border in pixels | 0 | Number |
border-radius | Corner roundness (higher = more rounded) | 100 | Number |
drop-shadow | Display a shadow beneath the button | true | Boolean |
icon | Icon to display | heart | heart, gift, giving_hands, ticket, none |
icon-position | Position of the icon | left | left, right |
type | How the button opens the form | modal | modal, link |
max-width | Maximum width of the modal | 560px | CSS value |
Positioning
Use these attributes to create a fixed-position floating button:| Attribute | Description | Default | Options |
|---|---|---|---|
position | Fixed position on the screen | None | top-left, top-right, middle-left, middle-right, bottom-left, bottom-right |
vertical-offset | Vertical offset from edge (pixels) | 25 | Number |
horizontal-offset | Horizontal offset from edge (pixels) | 25 | Number |
Examples
Troubleshooting
Color not working? Hex codes must include the
# symbol (e.g., #FF8A00 not FF8A00).