observablehq

Is it possible to add a class to an input in observablehq?


I would like to add a custom class to an observablehq input so that Bootstrap styling can be applied (e.g. Inputs.select). Is this possible?


Solution

  • Yes. Here is an example:

    viewof bins = {
      const input = Inputs.range([3, 20], { step: 1, label: "Bins" });
      input.classList.add("hello");
      return input;
    }
    

    https://observablehq.com/d/54079bd6ddbb4e71