Skip to content

Select ​

Select user input.

Select example

Examples ​

js
import { Select } from "pencil.js";

const position = [100, 200];
const items = [
    null, // Selectable empty item
    "Unicorn",
    "Pony",
    "Doggy",
];
const options = {
    value: 1, // index of the default value
};
const select = new Select(position, items, options);

SelectOptions ​

Inherit from TextOptions and InputOptions.

NameTypeDefaultComment
valueNumber0Selected index of the select

Released under the MIT License.