@molecule/app-progress-bar-vue

Feature · progress-bar · App (browser) · v1.1.4 · Apache-2.0

Vue labeled progress bar with card wrapper

npm install @molecule/app-progress-bar-vue

npm · Source on GitHub

How it works

@molecule/app-progress-bar-vue is a ready-made progress-bar feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { createApp, defineComponent, h } from 'vue'
import { ProgressBar, ProgressCard } from '@molecule/app-progress-bar-vue'

const App = defineComponent({
  setup() {
    return () => [
      h(ProgressBar, { value: 65, label: 'Upload progress', valueLabel: '65%', color: 'primary' }),
      h(ProgressCard, {
        title: 'Storage used',
        description: '8.5 GB of 10 GB',
        value: 85,
        valueLabel: '85%',
        color: 'warning',
      }),
    ]
  },
})

createApp(App).mount('#app')

Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue

Reference

Vue labeled progress bar and progress-card wrapper.

Exports:

  • <ProgressBar> — standalone bar with optional label + value display.
  • <ProgressCard> — <Card>-wrapped progress display (title, icon, description, bar, optional extras slot).

The Vue counterpart of @molecule/app-progress-bar-react: the same props (React names), the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { createApp, defineComponent, h } from 'vue'
import { ProgressBar, ProgressCard } from '@molecule/app-progress-bar-vue'

const App = defineComponent({
  setup() {
    return () => [
      h(ProgressBar, { value: 65, label: 'Upload progress', valueLabel: '65%', color: 'primary' }),
      h(ProgressCard, {
        title: 'Storage used',
        description: '8.5 GB of 10 GB',
        value: 85,
        valueLabel: '85%',
        color: 'warning',
      }),
    ]
  },
})

createApp(App).mount('#app')

Type

feature

Installation

npm install @molecule/app-progress-bar-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

ProgressBarProps

Props accepted by the ProgressBar component.

interface ProgressBarProps {
  /** Current numeric value. */
  value: number
  /** Maximum (defaults to 100). */
  max?: number
  /** Optional label rendered above the track (a node, or its same-named slot). */
  label?: VNodeChild
  /** Optional value display on the right of the label row (a node, or its same-named slot). */
  valueLabel?: VNodeChild
  /**
   * Element id the track is named by (`aria-labelledby`). Wins over `label`
   * and the default accessible name — `ProgressCard` points it at its title.
   */
  labelledBy?: string
  /** Element id the track is described by (`aria-describedby`). */
  describedBy?: string
  /** Size preset — maps to ClassMap `progressHeight`. */
  size?: 'sm' | 'md' | 'lg'
  /** Color variant — maps to ClassMap `progressColor`. */
  color?: 'primary' | 'success' | 'warning' | 'error' | 'info'
  /** Extra classes on the outer wrapper. */
  className?: string
}

ProgressCardProps

Props accepted by the ProgressCard component.

interface ProgressCardProps {
  /** Card title (a node, or its same-named slot). */
  title: VNodeChild
  /** Optional supporting description below the title (a node, or its same-named slot). */
  description?: VNodeChild
  /** Optional icon shown in the card header (a node, or its same-named slot). */
  icon?: VNodeChild
  /** Current value. */
  value: number
  /** Maximum (defaults to 100). */
  max?: number
  /** Value display on the right of the header (a node, or its same-named slot). */
  valueLabel?: VNodeChild
  /** ProgressBar color. */
  color?: 'primary' | 'success' | 'warning' | 'error' | 'info'
  /** Extra classes on the Card wrapper. */
  className?: string
  /** Additional content rendered below the bar (the default slot). */
  children?: VNodeChild
}

Constants

ProgressBar

Labeled progress bar with optional value display.

Renders a [label ... valueLabel] header row above a track. The track itself uses the wired ClassMap progress tokens — swap the ClassMap bond to restyle without touching this component.

The track always carries an accessible name (aria-progressbar-name): labelledBy when given, else the rendered label, else t('progressBar.label', undefined, { defaultValue: 'Progress' }), read through useTranslation() so it follows a locale switch.

const ProgressBar: DefineComponent<
  ExtractPropTypes<{
    value: { type: NumberConstructor; required: true }
    max: { type: NumberConstructor; default: number }
    label: null
    valueLabel: null
    labelledBy: StringConstructor
    describedBy: StringConstructor
    size: { type: PropType<ProgressBarProps['size']>; default: string }
    color: { type: PropType<ProgressBarProps['color']>; default: string }
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      value: { type: NumberConstructor; required: true }
      max: { type: NumberConstructor; default: number }
      label: null
      valueLabel: null
      labelledBy: StringConstructor
      describedBy: StringConstructor
      size: { type: PropType<ProgressBarProps['size']>; default: string }
      color: { type: PropType<ProgressBarProps['color']>; default: string }
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  {
    size: 'sm' | 'md' | 'lg' | undefined
    color: 'primary' | 'success' | 'warning' | 'error' | 'info' | undefined
    max: number
  },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see ProgressBarProps).

Returns: The progress bar component.

ProgressCard

<Card>-wrapped progress display with title, optional icon and description, the progress bar itself, and an optional extras slot below. Useful for budget/goal cards, storage-used panels, onboarding progress, etc.

The bar is named by the title (aria-labelledby) and, when a description renders, described by it (aria-describedby).

const ProgressCard: DefineComponent<
  ExtractPropTypes<{
    title: null
    description: null
    icon: null
    value: { type: NumberConstructor; required: true }
    max: { type: NumberConstructor; default: number }
    valueLabel: null
    color: { type: PropType<ProgressCardProps['color']>; default: string }
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      title: null
      description: null
      icon: null
      value: { type: NumberConstructor; required: true }
      max: { type: NumberConstructor; default: number }
      valueLabel: null
      color: { type: PropType<ProgressCardProps['color']>; default: string }
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  { color: 'primary' | 'success' | 'warning' | 'error' | 'info' | undefined; max: number },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see ProgressCardProps).

Returns: The progress card component.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-vue ^1.1.0
  • @molecule/app-vue ^3.13.0 || ^4.0.0
  • vue ^3.5.0

Runtime Dependencies

  • @molecule/app-ui
  • @molecule/app-ui-vue
  • @molecule/app-vue
  • vue

All visible text (label, valueLabel, title, description) is pass-through — supply already-translated strings. The track's fallback accessible name resolves through t('progressBar.label', undefined, { defaultValue: 'Progress' }) (read through useTranslation(), so it follows a locale switch); a rendered label or a labelledBy id names it instead. Requires a wired ClassMap bond: the track/fill styles come from the progress* ClassMap tokens, so colors follow the active theme. Node-valued props arrive as a prop AND a same-named slot; components accept either.

Translations

Translation strings are provided by @molecule/app-locales-progress-bar.