🤩
Windframe Import Update is finally here.

Multiselect

Angular Bootstrap Multiselect

Angular Bootstrap Multiselect is a form control, that after the click displays a collapsable list of multiple values which can be used in forms, menus or surveys.

Multiselect enables you to use and arrow keys to navigate through options and use key to select required option.

Importing the Contrast Angular Bootstrap Multiselect Module

To use the Contrast Angular Bootstrap Multiselect component in your project you need to import MultiselectModule.

typescript
import {MultiselectModule } from 'cdbangular';

Basic Multiselect

The Contrast Angular Bootstrap Multiselect Component takes in an options parameter whose value is an object of a user's different options.

Angular Bootstrap Mutiselect Basic

html
html
<CDBMultiselect [options]='option' selected="Value"></CDBMultiselect>
typescript
typescript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-multiselect',
templateUrl: './multiselect.component.html',
styleUrls: ['./multiselect.component.scss'],
})
export class MultiselectComponent implements OnInit {
option = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
selectOptions = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
constructor() {}
ngOnInit(): void {}
}

Multiselect with Search

Set the [search] property to true to enale users search for these options.

Angular Bootstrap Multiselect with search

html
html
<CDBMultiselect color="secondary" [search]=true [options]='option' selected="Value"></CDBMultiselect>
typescript
typescript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-multiselect',
templateUrl: './multiselect.component.html',
styleUrls: ['./multiselect.component.scss'],
})
export class MultiselectComponent implements OnInit {
option = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
selectOptions = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
constructor() {}
ngOnInit(): void {}
}

Multiselect with Submit Option

Angular Bootstrap Multiselect with Submit Option

html
html
<CDBMultiselect color="dark" [submit]=true [options]='option' selected="Value" ></CDBMultiselect>
typescript
typescript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-multiselect',
templateUrl: './multiselect.component.html',
styleUrls: ['./multiselect.component.scss'],
})
export class MultiselectComponent implements OnInit {
option = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
selectOptions = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
constructor() {}
ngOnInit(): void {}
}

Multiselect with Limited Options

Angular Bootstrap with Limited Options

html
html
<CDBMultiselect color="danger" [limitedOptions]=true [options]='option' selected="Value" ></CDBMultiselect>
typescript
typescript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-multiselect',
templateUrl: './multiselect.component.html',
styleUrls: ['./multiselect.component.scss'],
})
export class MultiselectComponent implements OnInit {
option = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
selectOptions = [
{
text: 'Value 1',
showing: true,
},
{
text: 'Second Value',
showing: true,
},
{
text: 'Third Value',
showing: true,
},
{
text: 'Final Value',
showing: true,
},
];
constructor() {}
ngOnInit(): void {}
}

Contrast Angular Bootstrap Multiselect Props

This section will build on your information about the props you get to use with the Contrast Angular Bootstrap Multiselect component. You will find out what these props do, their default values, and how you would use them in your code.

The table below lists other prop options of the CDBMultiselect component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
searchBooleanfalseSearch element will appear as the first child of select.search=true
colorStringprimarySets colorful hover effect on select options.color="secondary"
optionsarray of objectsSets options array as source of data. This property is used in alternative Select version.[options]='option'
selectedStringSet default select text content.selected="choose_option"

Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help reduce the amount of time we spend doing that, so we can focus on building some other aspects of the project. Contrast Bootstrap PRO consists of a UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

ad-banner

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast