How does one create a horizontal chip list in Material Angular that scrolls horizontally instead of taking up multiple rows?
This code solved our problem:
(We also used encapsulation: ViewEncapsulation.None
on our component).
::-webkit-scrollbar {
height: 0;
}
div.mat-chip-list-wrapper {
flex-wrap: nowrap;
overflow-x: auto;
width: 165px;
white-space: nowrap;
.mat-chip {
flex: 0 0 auto;
background: transparent;
color: var(--white);
}
}
.mat-chip-list {
margin-left: 20px;
}
.mat-chip.mat-standard-chip .mat-chip-remove {
color: var(--white);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With