Search/

Stats

Last modified:

Styling for important stats. Use stats to display a series of titled data points.

Variants

Example of Stats - default

React documentation

Last modified:

To start using the BcStats component in your project, ensure you import it as following:

import { BcStats } from '@bugcrowd/bc-elements'

BcStats props

PropTypeRequired?Purpose
variantstringrequiredSwitch between variants.
sizestringrequiredChange component text size.

Possible values for variant prop

variant valuesRequired?Description
verticalrequiredAligns stats vertically in a column.
inlinerequiredAligns the title and figure horizontally in a row. This removes the even distribution of stats horizontally.
unlinedrequiredRemoves the left border in each subsequent stat in ≥md and top border in <md.

Possible values for size prop

size valuesRequired?Description
xsrequiredSmall size.
lgrequiredLarge size.

Any extended types: No

BcStats.Stat

PropTypeRequired?Description
trendstringrequiredSets the trend: either up or down.

BcStats.Title

Title is used to set the stat title text.

BcStats.Figure

Figure is used to provide the provide stat figure, usually a number.

BcStats.Info

Info is used to provide additional information about BcStat.

Any extended types: No

HTML

Last modified:

Design

Last modified:

Preferably group the items as an unsorted list (<ul>) instead of with <div>s.

The following variants are available:

VariantPurpose
.bc-stats--inlineAligns the title and figure horizontally in a row. This removes the even distribution of stats horizontally.
.bc-stats--verticalAligns stats vertically in a column.
.bc-stats--unlinedRemoves the left border in each subsequent stat in ≥md and top border in <md.

For sizing:

VariantPurpose
.bc-stats--xsDecrease font size.
.bc-stats--lgIncrease font size.

Trend variants:

VariantPurpose
.bc-stat--uptrendChanges text color to green, to be used for an ‘up-trending’ number or percentage.
.bc-stat--downtrendChanges text color to red, to be used for a ‘down-trending’ number or percentage.

Accessibility

Last modified:

Rationale

Last modified:

See also

Last modified: