Select overview

Overview
API
Theme
Examples

NbSelectComponent

The NbSelectComponent provides a capability to select one of the passed items.

Showcase

Installation

Import NbSelectModule to your feature module.

@NgModule({
  imports: [
    // ...
    NbSelectModule,
  ],
})
export class PageModule { }

Usage

If you want to use it as the multi-select control you have to mark it as multiple. In this case, nb-select will work only with arrays - accept arrays and propagate arrays.

Multiple

Items without values will clean the selection. Both null and undefined values will also clean the selection.

Clean selection

Select may be bounded using selected input:

<nb-select [(selected)]="selected"></nb-selected>

Or you can bind control with form controls or ngModel:

Select form binding

Options in the select may be grouped using nb-option-group component.

Grouping

Select may have a placeholder that will be shown when nothing selected:

Placeholder

You can disable select, options and whole groups.

Disabled select

Also, the custom label may be provided in select. This custom label will be used for instead placeholder when something selected.

Custom label

Default nb-select size is medium and status is basic. Select is available in multiple colors using status property:

Select statuses

There are five select sizes:

Select sizes

And two additional style types - filled:

Filled select

and hero:

Select colors

Select is available in different shapes, that could be combined with the other properties:

Select shapes

By default, the component selects options whose values are strictly equal (===) with the select value. To change such behavior, pass a custom comparator function to the compareWith attribute.

Select custom comparator

You can add an additional icon to the select via the nb-form-field component:

Select with icon

NbOptionListComponent

The NbOptionListComponent is container component for NbOptionGroupComponent andNbOptionComponent list.

NbOptionGroupComponent

NbOptionGroupComponent

Radio
Previous page
Autocomplete
Next page

Need some help or found an issue?

Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.