Increase width a select dropdown

A simple thing but I can’t seem to see how I might increase the width of Input.select (i.e. a drop down menu). This is about a far as I’ve gotten:

viewof foo_v = {
    const s = Inputs.select(["one super long value in a drop down menu that goes beyond what can be seen"], {label: "foo"});
    s.input.style.width = "150%";
    return s;
} 

Obviously this didn’t work but can anyone recommend how I might increase the width of a dropdown menu?

There’s a “width” option on the select, so you can set the width like:

Inputs.select(["one super long value in a drop down menu that goes beyond what can be seen"], {label: "foo", width: 500})

Ah thanks for that. So this is something I’ve struggled with finding out. Where does one find options/arguments for observation functions?

A good place to start is this collection, which includes notebooks with a good amount of information about the various libraries commonly used on Observable: Libraries / Observable | Observable

The full documentation for Inputs is available here: inputs/README.md at main · observablehq/inputs · GitHub

For Plot, the documentation is here: Observable Plot | The JavaScript library for exploratory data visualization

1 Like