Skip to content

Examples

Async

Default window.crate object

See the Pen YYBdBL by Sam Denty (@samdenty99) on CodePen.

Initialising a custom crate object

See the Pen rpPoRW by Sam Denty (@samdenty99) on CodePen.

Multiple instances at the same time

See the Pen aEXPMw by Sam Denty (@samdenty99) on CodePen.

Updating the state

See the Pen LeqMae by Sam Denty (@samdenty99) on CodePen.

Dynamically interacting with the button

See the Pen goqZEZ by Sam Denty (@samdenty99) on CodePen.


Sync

We recommend using the async version of the API, as it'll make your website way faster. The synchronous version should only be used if it's being dynamically inserted into your website after the page's initial load (eg. A custom JS script)

Initialising a custom crate object

See the Pen ppGqYJ by Sam Denty (@samdenty99) on CodePen.