Open this example in the interactive library
Live preview
Source code
// components/RangeSpanReadout.tsx
export default function RangeSpanReadout({
values = [2, 3, 3, 6, 11],
}: { values?: number[] } = {}) {
return (
<output>
{values.length
? "Span: " + (Math.max(...values) - Math.min(...values))
: "No observations"}
</output>
);
}
