1.0.0 • Published 8 months ago

@spectrum-web-components/progress-bar v1.0.0

Weekly downloads
146
License
Apache-2.0
Repository
github
Last release
8 months 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.

1.0.0-rc.9

8 months ago

1.0.0-rc.7

8 months ago

1.0.0-rc.8

8 months ago

1.0.0-rc.5

8 months ago

1.0.0-rc.6

8 months ago

1.0.0-rc.10

8 months ago

1.0.0-rc.3

8 months ago

1.0.0-rc.4

8 months ago

1.0.0-rc.1

8 months ago

1.0.0-rc.2

8 months ago

0.50.0-beta.11

8 months ago

0.50.0-beta.12

8 months ago

0.50.0-beta.10

8 months ago

1.1.0-beta.1

8 months ago

1.1.0-beta.0

8 months ago

0.50.0-beta.9

8 months ago

0.50.0-beta.8

8 months ago

0.50.0-beta.7

8 months ago

0.50.0-beta.6

8 months ago

0.50.0-beta.5

8 months ago

0.50.0-beta.4

8 months ago

1.0.0

8 months ago

0.50.0-beta.3

8 months ago

0.50.0-beta.2

8 months ago

1.0.0-rc.0

8 months ago

0.50.0-beta.1

8 months ago

0.50.0-beta.0

8 months ago

0.49.0

8 months ago

0.49.0-beta.2

8 months ago

0.49.0-beta.1

8 months ago

0.48.1

9 months ago

0.48.0-beta.0

9 months ago

0.48.0-beta.1

9 months ago

0.48.0-beta.2

9 months ago

0.49.0-beta.0

9 months ago

0.43.0

1 year ago

0.48.0

9 months ago

0.44.0

11 months ago

0.45.0

11 months ago

0.46.0

10 months ago

0.42.5

1 year ago

0.47.1

10 months ago

0.47.2

9 months ago

0.47.0

10 months ago

0.42.4

1 year ago

0.42.3

1 year ago

0.42.2

1 year ago

0.42.1

1 year ago

0.42.0

1 year ago

0.41.2

1 year ago

0.41.1

1 year ago

0.41.0

1 year ago

0.40.5

1 year ago

0.40.4

1 year ago

0.40.3

1 year ago

0.40.2

1 year ago

0.40.1

2 years ago

0.36.0

2 years ago

0.40.0

2 years ago

0.35.1-rc.15

2 years ago

0.37.0

2 years ago

0.34.1-rc.0

2 years ago

0.35.1-rc.25

2 years ago

0.35.1-rc.26

2 years ago

0.35.1-rc.24

2 years ago

0.38.0

2 years ago

0.35.1-rc.34

2 years ago

0.34.0

2 years ago

0.35.1-rc.43

2 years ago

0.35.1-rc.41

2 years ago

0.39.1

2 years ago

0.39.0

2 years ago

0.35.0

2 years ago

0.39.4

2 years ago

0.39.3

2 years ago

0.39.2

2 years ago

0.31.1-react.21

2 years ago

0.32.0

2 years ago

0.31.1-react.3

2 years ago

0.31.1-react.2

2 years ago

0.33.2

2 years ago

0.33.0

2 years ago

0.30.0

2 years ago

0.31.0

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.5-overlay.18

2 years ago

0.9.3-overlay.22

2 years ago

0.9.5-overlay.17

2 years ago

0.9.5-overlay.15

2 years ago

0.9.5-overlay.14

2 years ago

0.9.5-overlay.13

2 years ago

0.9.5-overlay.12

2 years ago

0.9.5-overlay.11

2 years ago

0.9.5-overlay.10

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.3-overlay.8

2 years ago

0.9.3-overlay.9

2 years ago

0.9.1-overlay.37

2 years ago

0.8.8-react.75

2 years ago

0.8.8-react.48

2 years ago

0.8.8-react.49

2 years ago

0.8.8-react.50

2 years ago

0.9.0

2 years ago

0.8.5

3 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.5-react.54

3 years ago

0.8.8-react.32

2 years ago

0.8.4

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.7.0-devmode.0

3 years ago

0.5.14-devmode.7

3 years ago

0.5.12

3 years ago

0.5.14-devmode.0

3 years ago

0.5.13

3 years ago

0.6.1-devmode2.0

3 years ago

0.6.1-devmode.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.10

3 years ago

0.5.11

3 years ago

0.5.9

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.5-express.9

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.3-express.0

3 years ago

0.5.4-express.12

3 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.1

4 years ago

0.4.1-lit-next.0

4 years ago

0.4.0

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.9-lit-next.0

4 years ago

0.3.8-lit-next.0

4 years ago

0.3.7

4 years ago

0.3.7-lit-next.0

4 years ago

0.3.6

4 years ago

0.3.6-beta.3

4 years ago

0.3.6-alpha.1

4 years ago

0.3.5

4 years ago

0.3.5-alpha.1

4 years ago

0.3.4

4 years ago

0.3.4-alpha.1

4 years ago

0.3.3

4 years ago

0.3.3-alpha.1

4 years ago

0.3.2

4 years ago

0.3.2-alpha.1

4 years ago

0.3.1

4 years ago

0.3.1-alpha.47

4 years ago

0.3.1-alpha.46

4 years ago

0.3.1-alpha.45

4 years ago

0.3.1-alpha.34

4 years ago

0.3.1-alpha.0

4 years ago

0.3.0

4 years ago

0.2.8-alpha.0

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5-alpha.26

4 years ago

0.2.5

4 years ago

0.2.5-alpha.23

4 years ago

0.2.5-alpha.21

4 years ago

0.2.5-alpha.10

4 years ago

0.2.5-alpha.11

4 years ago

0.2.5-alpha.12

4 years ago

0.2.5-alpha.17

4 years ago

0.2.5-beta.17

4 years ago

0.2.5-beta.15

4 years ago

0.2.5-beta.16

4 years ago

0.2.5-beta.10

4 years ago

0.2.5-beta.13

4 years ago

0.2.5-beta.14

4 years ago

0.2.5-beta.11

4 years ago

0.2.5-beta.12

4 years ago

0.2.5-alpha.9

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1-alpha.33

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago