Skip to main content

Loading

A loading indicator, centered within the widget. Use it while a widget waits for data, e.g. for the first value of a metric.

function Loading(): JSX.Element

Example

src/widgets/example/Example.tsx
import React from 'react'
import {Loading, useMetricField} from '@modbros/dashboard-sdk'

export default function Example() {
const channelValue = useMetricField({field: 'metric'})

if (!channelValue) {
return <Loading/>
}

return <span>{channelValue.value.value}</span>
}