@brainfish-ai/nudge-widget
v0.1.3
Published
A Nudge widget build with SolidJS to notify user for any updates from Brainfish platform.
Keywords
Readme
Brainfish Nudge Widget
A Nudge widget build with SolidJS to notify user for any updates from Brainfish platform.
Installation
This package can be installed through the NPM registry by running the following command:
npm install @brainfish-ai/nudge-widgetAlternatively, it can also be loaded as a script in HTML.
<!DOCTYPE html>
<head>
<!-- ONLY load one of the following module type -->
<!-- ESM version -->
<script id="brainfish-nudges" src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js" type="module" async crossorigin="anonymous"></script>
<!-- UMD version -->
<script id="brainfish-nudges" src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.umd.js" type="text/javascript" async crossorigin="anonymous"></script>
</head>
<body>
<!-- Body content -->
</body>Usage
This package uses web component and will initialized when the script gets loaded or imported. A (shadow) DOM element will be created as part of the initialization.
Additionally, it exports a Nudge component itself and can be used like the following:
import { Nudge } from '@brainfish-ai/nudge-widget';
function Page() {
return (
<div>
<h1>Branfish!</h1>
<Nudge />
</div>
);
}