Open this example in the interactive library
Live preview
Source code
// components/BarLengthEstimator.tsx
export default function BarLengthEstimator({
bpm = 120,
beats = 4,
}: { bpm?: number; beats?: number } = {}) {
return <p>One bar: {((60 / Math.max(1, bpm)) * beats).toFixed(2)} seconds</p>;
}
