latest version

Select

Select option type.

Fields

Name Type Required Description
placeholder string   Specify input placeholder.
choices array yes List of items to choose from. Please checkout Choices structure.

Config

Name Type Default Description
size string "medium"
Specify the input size.

There are 4 sizes:
- "short", for short input.
- "medium", for normal input.
- "large", for a large input.
- "auto", to auto width input.
scroll number 5 Specify from what number of items to apply scroll.
search boolean false Enable or disable search feature.

DefaultValue

Name Type Default Description
value string|number   A string or number value.

Choices structure

Name Type Default Description
value string|number Any string or number value.
title string A valid value title.
icon string Add a custom icon for select item.

Minimal Usage

{
  id: "names",
  type: "select"
  choices: [
    { value: "john", title: "John" },
    { value: "andy", title: "Andy" },
    { value: "tom", title: "Tom" }
  ],
}

Usage

{
  id: "name",
  type: "select",
  config: {
    size: "medium",
    scroll: 5,
    placeholder: "Select name",
    search: true,
  },
  choices: [
    { value: "john", title: "John", icon: "nc-user" },
    { value: "andy", title: "Andy", icon: "nc-user" },
    { value: "tom", title: "Tom", icon: "nc-user" }
  ],
  defaultValue: {
    value: "john",
  }
},