Not sure in what scenario you want to add this, but have a look at this:
https://css-tricks.com/css3-progress-bars/
This is classic HTML and CSS "trick" to create a bar which you can define length of.
The basics of it is that you have a "wrapper" element that defines the maximum length, and a "bar" element inside that you set width: [0-100]%
and a background color of that.
This would be an example on how to create a 50% wide blue bar.
.wrapper {
width: 100%;
}
.bar {
background: blue;
height: 5px;
}
<div class="wrapper">
<div class="bar" style="width: 50%"></div>
</div>
Use that to create an angular component that you can send you width to, something like this:
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-bar',
template: `
<div class="wrapper">
<div class="bar" [style.width]="width"></div>
</div>
`,
styles: [`
.wrapper {
width: 100%;
}
.bar {
background: blue;
height: 5px;
}
`]
})
export class BarComponent {
@Input() width: number;
}