2.0.0-rc.4 • Published 9 months ago

@asphalt-react/progress-bar v2.0.0-rc.4

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
9 months ago

ProgressBar

npm

ProgressBar shows the progress of an activity to the user in a linear fashion. Use this component to display a determinate state of the activity with a value within 0 & 100. It can show the percentage of completion, which is hidden by default.

The ProgressBar has 3 sizes and multiple intents. It adapts to various screens to ensure responsiveness.

Usage

import { ProgressBar } from "@asphalt-react/progress-bar"

<ProgressBar value={25} />

Intents

ProgressBar supports 6 intents: info (default), success, warning, danger, neutral, brand

Competing intents

If a ProgressBar receives multiple intents, it fallbacks to the "info" intent. For example:

<ProgressBar value={20} danger success>

This will render a progress bar with "info" intent.

Accessibility

  1. ProgressBar has an implicit role of progressbar.
  2. The value of the ProgressBar determines the aria-valuenow attribute.
  3. ProgressBar accepts all the aria-* attributes.

Responsive behavior

ProgressBar stretches to fit its container, but has a minimum width set to "288px". It adapts in smaller screens (below 600px) and sets the minimum width to "144px".

Props

size

Controls size of ProgressBar. Possible values are "s", "m", "l" for small, medium & large respectively.

typerequireddefault
enumfalse"m"

value

Percentage value of the progress. Accepts a number between 0 & 100, including the ends.

typerequireddefault
numberfalse0

showValue

Determines whether to show progress percentage value or not.

typerequireddefault
boolfalsefalse

info

Applies info intent.

typerequireddefault
boolfalsefalse

success

Applies success intent.

typerequireddefault
boolfalsefalse

warning

Applies danger intent.

typerequireddefault
boolfalsefalse

danger

Applies danger intent.

typerequireddefault
boolfalsefalse

neutral

Applies neutral intent.

typerequireddefault
boolfalsefalse

brand

Applies brand intent.

typerequireddefault
boolfalsefalse