# SelectInputArgs

Interface · extends [`IBindableArgs`](https://api.playcanvas.com/pcui/interfaces/IBindableArgs.md)`<unknown>`, [`IPlaceholderArgs`](https://api.playcanvas.com/pcui/interfaces/IPlaceholderArgs.md)

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/components/SelectInput/index.ts#L40

The arguments for the [SelectInput](https://api.playcanvas.com/pcui/classes/SelectInput.md) constructor.

## Properties

### allowCreate

```ts
allowCreate?: boolean
```

If `true` then the input allows creating new values from the text field. Only used when allowInput is true. Defaults to `false`.

### allowInput

```ts
allowInput?: boolean
```

If `true` then a text field is shown for the user to search for values or enter new ones. Defaults to `false`.

### allowNull

```ts
allowNull?: boolean
```

If `true` then null is a valid input value. Defaults to `false`.

### createFn

```ts
createFn?: (value: string) => void
```

A function to be executed when the user selects to create a new value. The function takes the new value as a parameter.

### createLabelText

```ts
createLabelText?: string
```

The placeholder text to show when creating a new value. Used when allowInput and allowCreate are both true.

### defaultValue

```ts
defaultValue?: unknown
```

Default value for the input.

### disabledOptions

```ts
disabledOptions?: Record<string, string>
```

All the option values that should be disabled. The keys of the object are the values of the options and the values are the text to show when the option is disabled.

### fallbackOrder

```ts
fallbackOrder?: string[]
```

The order that the options should be checked in to find a valid fallback option that isn't included in the disabledOptions object.

### invalidOptions

```ts
invalidOptions?: unknown[]
```

An array of values against which new values are checked before they are created. If a value is in the array it will not be created.

### multiSelect

```ts
multiSelect?: boolean
```

If `true` then the input value becomes an array allowing the selection of multiple options. Defaults to `false`.

### onSelect

```ts
onSelect?: (value: unknown) => void
```

If provided, this function will be called each time an option is selected.

### options

```ts
options?: { t: string; v: string | number | boolean }[]
```

The dropdown options of the input. Contains an array of objects with the following format {v: Any, t: String} where v is the value and t is the text of the option.

### optionsFn

```ts
optionsFn?: () => { t: string; v: OptionValue }[]
```

Used to map the options.

### prefix

```ts
prefix?: string
```

Text to display in the SelectInput before the selected option.

### type

```ts
type?: "string" | "number" | "boolean"
```

The type of each value. Can be one of 'string', 'number' or 'boolean'. Defaults to 'string'.

## Inherited from ElementArgs

- `alignItems?: string`
- `alignSelf?: string`
- `binding?: BindingBase`
- `class?: string | string[]`
- `dom?: string | HTMLElement`
- `enabled?: boolean`
- `error?: boolean`
- `flexBasis?: string | number`
- `flexDirection?: string`
- `flexGrow?: string | number`
- `flexShrink?: string | number`
- `flexWrap?: string`
- `height?: number`
- `hidden?: boolean`
- `id?: string`
- `ignoreParent?: boolean`
- `isRoot?: boolean`
- `justifyContent?: string`
- `justifySelf?: string`
- `link?: { observer: Observer | Observer[]; path: string | string[] }`
- `onChange?: (value: unknown) => void`
- `onClick?: () => void`
- `onRemove?: () => void`
- `parent?: Element`
- `readOnly?: boolean`
- `style?: string`
- `tabIndex?: number`
- `width?: number`

## Inherited from [IPlaceholderArgs](https://api.playcanvas.com/pcui/interfaces/IPlaceholderArgs.md)

- `placeholder?: string`

## Inherited from [IBindableArgs](https://api.playcanvas.com/pcui/interfaces/IBindableArgs.md)

- `renderChanges?: boolean`
- `value?: unknown`
- `values?: unknown[]`
