0.42.2 • Published 27 days ago

@spectrum-web-components/progress-bar v0.42.2

Weekly downloads
146
License
Apache-2.0
Repository
github
Last release
27 days ago

Description

An <sp-progress-bar> shows the progression of a system operation such as downloading, uploading, processing, etc. in a visual way. It can represent determinate or indeterminate progress.

Usage

See it on NPM! How big is this package in your project? Try it on webcomponents.dev

yarn add @spectrum-web-components/progress-bar

Import the side effectful registration of <sp-progress-bar> via:

import '@spectrum-web-components/progress-bar/sp-progress-bar.js';

When looking to leverage the ProgressBar base class as a type and/or for extension purposes, do so via:

import { ProgressBar } from '@spectrum-web-components/progress-bar';

Sizes

<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        size="s"
        label="Loaded a little"
        progress="22"
    ></sp-progress-bar>
</div>
<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        size="m"
        label="Loaded a little"
        progress="22"
    ></sp-progress-bar>
</div>
<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        size="l"
        label="Loaded a little"
        progress="22"
    ></sp-progress-bar>
</div>
<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        size="xl"
        label="Loaded a little"
        progress="22"
    ></sp-progress-bar>
</div>

Variants

Over background

When a progress bar needs to be placed on top of a colored background, use the over background progres bar as signified by [over-background]. This progress bar uses a white opaque color no matter the background. Make sure the background offers enough contrast for the loader to be legible.

<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around; background-color: var(--spectrum-transparent-black-400);"
>
    <sp-progress-bar
        label="Loaded a large amount"
        progress="77"
        over-background
    ></sp-progress-bar>
</div>

Indeterminate

A progress bar can be either determinate or indeterminate as signified by [indeterminate]. By default, loaders are determinate. Use a determinate loader when progress can be calculated against a specific goal (e.g., downloading a file of a known size). Use an indeterminate loader when progress is happening but the time or effort to completion can’t be determined (e.g., attempting to reconnect to a server).

<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        aria-label="Loaded an unclear amount"
        indeterminate
    ></sp-progress-bar>
</div>

The above sp-progress-bar also leverages the aria-label attribute in place of the label attribute in ensure that the element is labelled correctly without that label appearing visibly in the UI.

Side Label

A progress bar can be delivered with its labeling displayed above its visual indicator or to either side. Use the boolean [side-label] attribute to define where this content should appear.

<div
    style="width: 240px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: space-around;"
>
    <sp-progress-bar
        side-label
        indeterminate
        label="Label Beside"
    ></sp-progress-bar>
</div>

Accessibility

An sp-progress-bar element will register itself as a role="progressbar" element in the accessibility tree. Any value applied to the label attribute will be used both to visibly label the element and to set the aria-label attribute on the host. In cases where a visible label is not desired, be sure to include an aria-label attribute manually to ensure that the sp-progress-bar correctly fulfills its responsibilities to visitors of you site of all abilities.

0.42.2

27 days ago

0.42.1

28 days ago

0.42.0

1 month ago

0.41.2

2 months ago

0.41.1

2 months ago

0.41.0

3 months ago

0.40.5

3 months ago

0.40.4

3 months ago

0.40.3

4 months ago

0.40.2

4 months ago

0.40.1

5 months ago

0.36.0

9 months ago

0.40.0

6 months ago

0.35.1-rc.15

9 months ago

0.37.0

9 months ago

0.34.1-rc.0

10 months ago

0.35.1-rc.25

9 months ago

0.35.1-rc.26

9 months ago

0.35.1-rc.24

9 months ago

0.38.0

8 months ago

0.35.1-rc.34

9 months ago

0.34.0

10 months ago

0.35.1-rc.43

9 months ago

0.35.1-rc.41

9 months ago

0.39.1

7 months ago

0.39.0

7 months ago

0.35.0

9 months ago

0.39.4

6 months ago

0.39.3

6 months ago

0.39.2

7 months ago

0.33.3-overlay.66

10 months ago

0.33.3-overlay.65

10 months ago

0.33.3-overlay.61

10 months ago

0.31.1-react.21

11 months ago

0.32.0

11 months ago

0.31.1-react.3

12 months ago

0.31.1-react.2

12 months ago

0.30.1-overlay.30

12 months ago

0.33.1-overlay.39

11 months ago

0.30.1-overlay.31

12 months ago

0.33.2

11 months ago

0.33.0

11 months ago

0.30.1-overlay.38

12 months ago

0.30.1-overlay.37

12 months ago

0.30.1-overlay.41

12 months ago

0.30.1-overlay.42

12 months ago

0.30.1-overlay.40

12 months ago

0.30.0

12 months ago

0.33.1-overlay.41

11 months ago

0.32.1-overlay.33

11 months ago

0.32.1-overlay.41

11 months ago

0.31.0

12 months ago

0.31.1-overlay.29

12 months ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.9.3-overlay.8

1 year ago

0.9.3-overlay.9

1 year ago

0.8.8-react.75

1 year ago

0.8.8-react.48

1 year ago

0.8.8-react.49

1 year ago

0.8.8-react.50

1 year ago

0.9.0

1 year ago

0.8.5

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.8.5-react.54

1 year ago

0.8.8-react.32

1 year ago

0.8.4

1 year ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

1 year ago

0.8.2

2 years ago

0.7.0-devmode.0

2 years ago

0.5.14-devmode.7

2 years ago

0.5.12

2 years ago

0.5.14-devmode.0

2 years ago

0.5.13

2 years ago

0.6.1-devmode2.0

2 years ago

0.6.1-devmode.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.5-express.9

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.3-express.0

2 years ago

0.5.4-express.12

2 years ago

0.5.0

2 years ago

0.5.1

2 years ago

0.4.1

2 years ago

0.4.1-lit-next.0

2 years ago

0.4.0

2 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.9-lit-next.0

3 years ago

0.3.8-lit-next.0

3 years ago

0.3.7

3 years ago

0.3.7-lit-next.0

3 years ago

0.3.6

3 years ago

0.3.6-beta.3

3 years ago

0.3.6-alpha.1

3 years ago

0.3.5

3 years ago

0.3.5-alpha.1

3 years ago

0.3.4

3 years ago

0.3.4-alpha.1

3 years ago

0.3.3

3 years ago

0.3.3-alpha.1

3 years ago

0.3.2

3 years ago

0.3.2-alpha.1

3 years ago

0.3.1

3 years ago

0.3.1-alpha.47

3 years ago

0.3.1-alpha.46

3 years ago

0.3.1-alpha.45

3 years ago

0.3.1-alpha.34

3 years ago

0.3.1-alpha.0

3 years ago

0.3.0

3 years ago

0.2.8-alpha.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5-alpha.26

3 years ago

0.2.5

3 years ago

0.2.5-alpha.23

3 years ago

0.2.5-alpha.21

3 years ago

0.2.5-alpha.10

3 years ago

0.2.5-alpha.11

3 years ago

0.2.5-alpha.12

3 years ago

0.2.5-alpha.17

3 years ago

0.2.5-beta.17

3 years ago

0.2.5-beta.15

3 years ago

0.2.5-beta.16

3 years ago

0.2.5-beta.10

3 years ago

0.2.5-beta.13

3 years ago

0.2.5-beta.14

3 years ago

0.2.5-beta.11

3 years ago

0.2.5-beta.12

3 years ago

0.2.5-alpha.9

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1-alpha.33

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago