Thanks for reading! Support me with a tip below:
React embed component for Tip Top Jar widgets
npm install @tiptopjar/react-widget> React component library for embedding Tip Top Jar widgets into your website β the easiest way to let users leave you a tip πΈ.
---
To use this package, you need a Tip Top Jar account.
You can:
1. Embed widgets directly using the embed code provided on your Tip Top Jar dashboard, or
2. Integrate programmatically using this developer package (@tiptopjar/react-widget).
Sign up or log in at π https://tiptopjar.com
---
1. Overview
2. Installation
3. Quick Start
4. Widget Modes
- Inline Mode
- Floating Mode
- Button Mode
5. Props Reference
6. Examples
7. Next.js Usage
8. Customization Tips
9. FAQ
10. License
---
@tiptopjar/react-widget makes it easy for React developers to embed Tip Top Jar widgets directly into their apps.
It supports three distinct widget modes:
| Mode | Description |
|------|--------------|
| π§± Inline | Renders a full Tip Top Jar card directly in your page content. |
| π Floating | Displays a round floating βTipβ button that opens a side modal. |
| π¬ Button | Creates a pill-style link button to your Tip Top Jar page. |
---
Using Yarn (recommended):
``bash``
yarn add @tiptopjar/react-widget
Or npm:
`bash`
npm install @tiptopjar/react-widget
---
`tsx
import { TipTopJarEmbed } from '@tiptopjar/react-widget';
export default function App() {
return (
> π‘ No API keys or configuration needed β just your Tip Top Jar username.
---
π¨ Widget Modes
$3
Inline mode embeds a complete Tip Top Jar card directly in your layout.
`tsx
`Optional props
| Prop | Type | Default | Description |
| ----------- | ------------------- | ----------- | --------------------------------------------- |
|
origin | string | auto-detect | Override base domain (for advanced use cases) |
| className | string | β | Apply custom class to wrapper div |
| style | React.CSSProperties | β | Inline styling for wrapper |---
$3
Floating mode adds a round floating button that toggles a side modal Tip Jar card.
`tsx
username="hamza"
mode="floating"
position="bottom-right"
message="Fuel my work π₯"
xMargin={20}
yMargin={20}
/>
`Optional props
| Prop | Type | Default | Description |
| ---------- | --------------------------------- | --------------- | ------------------------------------ |
|
position | 'bottom-left' \| 'bottom-right' | 'bottom-left' | Where to anchor the floating button |
| xMargin | number | 18 | Horizontal offset |
| yMargin | number | 18 | Vertical offset |
| message | string | "Leave a tip" | Tooltip text shown near button |
| origin | string | auto-detect | Base domain (for advanced use cases) |---
$3
Button mode renders a standalone pill-style button linking to your Tip Top Jar page.
`tsx
username="hamza"
mode="button"
buttonColor="black"
buttonSize="md"
buttonText="Send a Tip"
/>
`Optional props
| Prop | Type | Default | Description |
| ------------- | ---------------------- | -------------- | ------------------------------------ |
|
buttonColor | 'black' \| 'white' | 'black' | Button color theme |
| buttonSize | 'sm' \| 'md' \| 'lg' | 'md' | Button size |
| buttonText | string | "Send a Tip" | Text label on the button |
| origin | string | auto-detect | Base domain (for advanced use cases) |---
π§© Props Reference
All widgets share these common props:
| Prop | Type | Required | Description |
| ----------- | ----------------------------------------- | -------- | ------------------------------------------------ |
|
username | string | β
| Your Tip Top Jar username |
| mode | 'inline' \| 'floating' \| 'button' | β
| Widget type |
| origin | string | β | Override default domain (for advanced use cases) |
| data | Record | β | Pass through extra data-* attributes |
| widgetSrc | string | β | Custom URL for widget loader script |
| className | string | β | Custom class for wrapper div |
| style | React.CSSProperties | β | Inline style for wrapper div |---
π‘ Examples
#### 1οΈβ£ Inline in a blog post
`tsx
Thanks for reading! Support me with a tip below:
`---
#### 2οΈβ£ Floating button on bottom-right
`tsx
username="hamza"
mode="floating"
position="bottom-right"
message="Leave a tip!"
/>
`---
#### 3οΈβ£ White button with large text
`tsx
username="hamza"
mode="button"
buttonColor="white"
buttonSize="lg"
buttonText="Buy me a coffee β"
/>
`---
βοΈ Next.js Usage
Since this widget injects