Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!-- Size small -->
<span data-view-component="true" class="Progress Progress--small">
<span style="width: 10%;" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span>
<span style="width: 20%;" data-view-component="true" class="Progress-item color-bg-accent-emphasis"></span>
<span style="width: 30%;" data-view-component="true" class="Progress-item color-bg-danger-emphasis"></span>
</span>
<!-- Size default -->
<span data-view-component="true" class="Progress">
<span style="width: 10%;" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span>
<span style="width: 20%;" data-view-component="true" class="Progress-item color-bg-accent-emphasis"></span>
<span style="width: 30%;" data-view-component="true" class="Progress-item color-bg-danger-emphasis"></span>
</span>
<!-- Size large -->
<span data-view-component="true" class="Progress Progress--large">
<span style="width: 10%;" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span>
<span style="width: 20%;" data-view-component="true" class="Progress-item color-bg-accent-emphasis"></span>
<span style="width: 30%;" data-view-component="true" class="Progress-item color-bg-danger-emphasis"></span>
</span>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Size small
render(Primer::Beta::ProgressBar.new(size: :small)) do |component|
component.with_item(percentage: 10)
component.with_item(bg: :accent_emphasis, percentage: 20)
component.with_item(bg: :danger_emphasis, percentage: 30)
end
# Size default
render(Primer::Beta::ProgressBar.new(size: :default)) do |component|
component.with_item(percentage: 10)
component.with_item(bg: :accent_emphasis, percentage: 20)
component.with_item(bg: :danger_emphasis, percentage: 30)
end
# Size large
render(Primer::Beta::ProgressBar.new(size: :large)) do |component|
component.with_item(percentage: 10)
component.with_item(bg: :accent_emphasis, percentage: 20)
component.with_item(bg: :danger_emphasis, percentage: 30)
end

app/components/primer/beta/progress_bar.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Progress */
.Progress {
display: flex;
height: 8px;
overflow: hidden;
background-color: var(--bgColor-neutral-muted);
border-radius: 6px;
outline: 1px solid transparent; /* Support Firefox custom colors */
}
.Progress--large {
height: 10px;
}
.Progress--small {
height: 5px;
}
.Progress-item {
outline: 2px solid transparent; /* Support Firefox custom colors */
}
.Progress-item + .Progress-item {
margin-left: 2px;
}