hub-dashboard-addons
v1.1.0
Published
A library that provides Hub dashboard API for creating custom widgets
Downloads
1,097
Readme
hub-dashboard-addons
A library that provides Hub dashboard API for creating custom widgets.
Installation
NPM
npm install hub-dashboard-addons
CDN
<!-- Optional: default styles of dashboard widgets -->
<link rel="stylesheet" type="text/css" href="https://unpkg.com/hub-dashboard-addons@latest/dashboard.css">
<!-- Include dashboard connector from CDN -->
<script src="https://unpkg.com/hub-dashboard-addons@latest"></script>
USAGE
// Would be just window.DashboardAddons if included from CDN
import DashboardAddons from 'hub-dashboard-addons';
// Optional, if use webpack with css-loader
import 'hub-dashboard-addons/dashboard.css';
DashboardAddons.registerWidget((dashboardApi, registerWidgetApi) => {
registerWidgetApi({
onRefresh: () => {
console.log('refresh');
dashboardApi.setTitle('Refreshed');
}
});
});