JSFiddle - React, Tailwind, and code Playground

HTML

<label class="indeterminate">Hello <input type="checkbox" /></label>

JavaScript

const input = document.querySelectorAll('input')[0];
const label = document.querySelectorAll('label')[0];

input.indeterminate = true;

label.addEventListener('click', ev => {
	if(input.indeterminate){
    input.indeterminate = false;
    ev.preventDefault();
  }
})