Skip to content

Bar

Install

Please install the @canvasengine/presets package first.

bash
npm install @canvasengine/presets

Then, you can use the presets in your project.

Usage

html
<Canvas>
    <Bar width="200" height="20" value="50" maxValue="100" backgroundColor="#333" foregroundColor="#f00" />
</Canvas>

<script>
    import { Bar } from '@canvasengine/presets'
</script>

Props

PropTypeRequiredDefaultDescription
backgroundColorstringNo'#333333'Background color of the bar
foregroundColorstringNo'#ffffff'Color of the progress bar
valuenumberYes-Current value of the progress bar
maxValuenumberYes-Maximum value of the progress bar
widthnumberYes-Width of the bar in pixels
heightnumberYes-Height of the bar in pixels