javascripthtmlcssangularjsangular-ui-select

How to customize group label in Angular UI-Select


In Angular ui-select (GitHub Link), how can I customize group label?

enter image description here

As shown in the image, the list is grouped by country, how can I customize the group label so to make it larger then the selection items?

Plunker Example

<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="disabled" style="min-width: 300px;" title="Choose a person">
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices group-by="'country'" repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
  <div ng-bind-html="person.name | highlight: $select.search"></div>
  <small>
    email: {{person.email}}
    age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
  </small>
</ui-select-choices>
</ui-select>

The example is modified from the official example link.

Thanks in advance.


Solution

  • I simply targeted the CSS class that was bound to the group by label as follow:

    .ui-select-choices-group-label {
      font-size: 20px;
    }
    

    You can see the updated Plunkr here