Meter

A visual representation of a value within a known range.

Installation

Install the component package, shared coss-svelte theme, and Bits UI peer.

npm install coss-svelte @coss-svelte/theme bits-ui

Usage

Import the Svelte component exports directly from the package.

import { Meter, MeterIndicator, MeterLabel, MeterTrack, MeterValue } from "coss-svelte";

Anatomy

  • Meter
  • MeterIndicator
  • MeterLabel
  • MeterTrack
  • MeterValue

API Reference

Meter

A visual representation of a value within a known range.

PropTypeDefaultDescription
valuenumber70Current value for the component. Bind with `bind:value` when supported.
minnumber0Minimum value for the control.
maxnumber100Maximum value for the control.
labelstring""Accessible label or fallback visible label for the control.
styleany""Inline style forwarded to the rendered element.
children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI Meter.Root.

MeterIndicator

Renders the visual indicator for the current value or state.

children : Snippet<[]>

Inherits from Svelte <span> attributes.

MeterLabel

Labels the parent component or a grouped section.

children : Snippet<[]>

Inherits from Svelte <span> attributes.

MeterTrack

Renders the track that contains the current value indicator.

children : Snippet<[]>

Inherits from Svelte <span> attributes.

MeterValue

Renders the current value for the parent component.

children : Snippet<[]>

Inherits from Svelte <span> attributes.

Implementation Details

Status
Stable
Foundation
bits
Category
Feedback & Status
Particles
4