Package Exports
- @shardlabs/kusama-tips-widget
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@shardlabs/kusama-tips-widget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Kusama Tips Widget
Install
Using CDN: Add the following script to the end of your <head> section.
<script src="https://unpkg.com/@shardlabs/kusama-tips-widget@latest/dist/bundle.min.js"></script>Usage
Binding the widget:
kusamaTipsWidget.bind(target, options)Minimal example:
<script>
kusamaTipsWidget.bind(document.body, {
beneficiary: "5EhR5PRsX...",
});
</script>Use custom button element:
<script>
kusamaTipsWidget.bind(document.body, {
beneficiary: "5EhR5PRsX...",
element: document.getElementById("my-button"),
});
</script>You can disable proposals by passing allowProposing: false to the options object:
<script>
kusamaTipsWidget.bind(document.body, {
beneficiary: "5EhR5PRsX...",
buttonText: "Donate KSM",
allowProposing: false,
});
</script>Options
| Property | Description | Required | Default |
|---|---|---|---|
| beneficiary | The account to be credited with the assets. Use your substrate address here. | Yes | - |
| element | A custom DOM element on which a click handler will be registered. | No | - |
| buttonText | A custom text for the button if the default value does not fit your use case. | No | Kusama Tips |
| allowProposing | A flag to control tip proposing. This flag can be set to false in cases where tip proposing is not desired or should not be allowed. Tip proposing is allowed by default. |
No | true |