Skip to content

[Help List]selecting a list-item in mat-nav-list? #25887

@diuming

Description

@diuming

Feature Description

Hi,

I exercise mat-nav-list in sidenav.
How do I draw background when I selected a mat-list-item? (Do you provide a good way to do this?)
Can I set a default mat-list-item be selected?
How do I place a prefix Icon <mat-icon matListIcon>folder</mat-icon> in mat-list-item?
thanks.

<mat-sidenav-container>
    <mat-sidenav mode="side" opened="true">
        <mat-nav-list>
            <a mat-list-item href="..." *ngFor="let link of links"> {{ link }} </a>
         </mat-nav-list>
    </mat-sidenav>
</mat-sidenav-container>

Screen Shot 2022-10-28 at 10 08 57 AM

Better

Screen Shot 2022-10-28 at 9 41 32 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/list

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions