Soracom

Design System
  1. Home
  2. Design system
  3. Elements
  4. Scale

Scale

Overview

Scale is a basic html only implementation of a scale/bar chart

CSS Variables

The following css variables can be set using css, a style tag or javascript to control this component

VariableTypeDefaultDescription
—ds-scale-pcpercentage0%Sets the width of the bar
—ds-scale-widthpercentage100%Sets the width of the overall scale

Options

Basic usage

The minimum requirement is to set the --ds-scale-pc css variable to control the width of the scales bar. This must be a percentage value, ie. --ds-scale-pc: 40% or css calculation that results in a percentage, ie. --ds-scale-pc: calc(1 / 3 * 100%).

Scale element

html
Copy
document.getElementById("customScale").style.setProperty('--ds-scale-pc', "33%")

<div id="customScale" class="ds-scale"></div>

Styles

Progress

html
Copy

Component color

Default style

html
Copy

Progress style

html
Copy