Picker
To create the picker, use the following
let elements = [
{
type: "picker"
}
];
The items
array defines the options available in the picker. Each option is represented as an array with two elements:
- Value: The internal value assigned to the option (used for logic handling).
- Label: The text displayed to the user.
let items = [
["none", "select a car---"], // Placeholder option
["tesla", "Tesla"], // Tesla as a selectable option
["audi", "Audi"] // Audi as a selectable option
];
return new Picker()
.set({
items: items,
font: "Arial",
arrayPadding: ({sides: ["all"], value: "0.5rem"}),
rounded: true
})