Bars

Bars represent the progress of a task or the value within the known range. Bars are custom components for displaying HTML5 <progress>, <meter> and input range elements.

10
15
25
40
10

<script>
    import { Bars } from 'svelte-spectre';

    let state = {
        value: 100,
        min: 10,
        low: 25,
        high: 50,
        max: 90,
        striped: false,
        animated: false,
        labled: true,
        auto: false,
    };

    $: items = state.auto
        ? []
        : [
              { value: 10, striped: true, animated: true, color: 'secondary' },
              { value: 15, striped: true, animated: true, color: 'error' },
              { value: 25, striped: true, animated: true, color: 'warning' },
              { value: 40, striped: true, animated: true, color: 'success' },
              { value: 10, striped: true, animated: true },
          ];
</script>

<Bars { ...state } bind:items />
© 2022 — 2023 BASF SE

API Bars

items: Item[]
Items array
type Item = { value: number; label?: string; color: Color; striped: boolean; animated: boolean; invisible?: boolean; tooltip?: { pos: string; label: string; }; };
auto: boolean
Autofilled bars by value. items = [] needed
true | false
value: number = 0
Current numeric value (auto: true).
any number
min: number = 0
The lower numeric bound of the measured range (auto: true).
any number
low: number = 25
The upper numeric bound of the low end of the measured range (auto: true).
any number
high: number = 50
The lower numeric bound of the high end of the measured range (auto: true).
any number
max: number = 100
The upper numeric bound of the measured range (auto: true).
any number
striped: boolean
Striped indicator.
true | false
animated: boolean
Striped animated indicator.
true | false
labled: boolean
Labled bars indicator.
true | false
thin: boolean
Thin bar.
true | false