Skip to content

Custom icons for sorting #16560

@CameronEzraJones

Description

@CameronEzraJones

Feature Description

Allow for the customization of the arrow with sorting

Use Case

Currently, sort headers have a little arrow indicating the direction of the sort:
image
Looking through the source code, I noticed that the icon isn't really an icon, but a collection of divs that are styled to look like an arrow (in src/material/sort/sort-header.html):

<div class="mat-sort-header-arrow"
       *ngIf="_renderArrow()"
       [@arrowOpacity]="_getArrowViewState()"
       [@arrowPosition]="_getArrowViewState()"
       [@allowChildren]="_getArrowDirectionState()"
       (@arrowPosition.start)="_disableViewStateAnimation = true"
       (@arrowPosition.done)="_disableViewStateAnimation = false">
    <div class="mat-sort-header-stem"></div>
    <div class="mat-sort-header-indicator" [@indicator]="_getArrowDirectionState()">
      <div class="mat-sort-header-pointer-left" [@leftPointer]="_getArrowDirectionState()"></div>
      <div class="mat-sort-header-pointer-right" [@rightPointer]="_getArrowDirectionState()"></div>
      <div class="mat-sort-header-pointer-middle"></div>
    </div>
  </div>

As a developer that wants to build a theme based off Material, I would like to be able to

  1. Specify a custom icon such as a carat or chevron
  2. Allow for the disabling of sort animations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions