@molecule/app-checklist-vue

Feature · checklist · App (browser) · v1.1.2 · Apache-2.0

Onboarding checklist with checkable items + progress bar

npm install @molecule/app-checklist-vue

npm · Source on GitHub

How it works

@molecule/app-checklist-vue is a ready-made checklist 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 { Checklist } from '@molecule/app-checklist-vue'

const App = defineComponent({
  setup() {
    return () =>
      h(Checklist, {
        title: 'Getting started',
        items: [
          { id: 'profile', label: 'Complete your profile', completed: true },
          { id: 'invite', label: 'Invite a team member', completed: false },
          { id: 'project', label: 'Create your first project', completed: false },
        ],
        onToggle: (id, next) => updateItem(id, next),
      })
  },
})

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

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

Reference

Vue onboarding checklist with checkboxes and overall progress bar.

Exports <Checklist> and the ChecklistItem type. It is the Vue counterpart of @molecule/app-checklist-react: the same props (React names), the same DOM for the same input, and the same onToggle calls, so an app switches framework by changing only the package name in its imports.

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 { Checklist } from '@molecule/app-checklist-vue'

const App = defineComponent({
  setup() {
    return () =>
      h(Checklist, {
        title: 'Getting started',
        items: [
          { id: 'profile', label: 'Complete your profile', completed: true },
          { id: 'invite', label: 'Invite a team member', completed: false },
          { id: 'project', label: 'Create your first project', completed: false },
        ],
        onToggle: (id, next) => updateItem(id, next),
      })
  },
})

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

Type

feature

Installation

npm install @molecule/app-checklist-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

ChecklistItem

A single item in the checklist, tracking its label, description, and completion state.

interface ChecklistItem {
  /** Stable identity, used as the list key and the checkbox `aria-label` fallback. */
  id: string
  /** Item label: text, or a node (also passable as the same-named slot of a checkbox). */
  label: VNodeChild
  /** Optional description / hint shown under the label. */
  description?: VNodeChild
  /** Completion state. */
  completed: boolean
  /** When true, the item is rendered disabled and uncheckable. */
  disabled?: boolean
}

ChecklistProps

Props accepted by the Checklist component.

interface ChecklistProps {
  /** The checklist items, rendered in order. */
  items: ChecklistItem[]
  /** Called when an item is toggled, with its id and the checkbox's new state. */
  onToggle: (id: string, next: boolean) => void
  /** Show overall progress bar above the list. Defaults to true. */
  showProgress?: boolean
  /** Optional title above the checklist: a prop, or the same-named slot. */
  title?: VNodeChild
  /** Extra classes on the outer wrapper. */
  className?: string
}

Constants

Checklist

Onboarding-style checklist with checkboxes, optional descriptions, and an overall progress bar derived from items.

Fully controlled: it never mutates completed; the caller persists the toggle in onToggle(id, next) and passes updated items again.

const Checklist: DefineComponent<
  ExtractPropTypes<{
    items: { type: PropType<ChecklistItem[]>; default: () => never[] }
    onToggle: { type: PropType<(id: string, next: boolean) => void>; default: undefined }
    showProgress: { type: BooleanConstructor; default: boolean }
    title: null
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      items: { type: PropType<ChecklistItem[]>; default: () => never[] }
      onToggle: { type: PropType<(id: string, next: boolean) => void>; default: undefined }
      showProgress: { type: BooleanConstructor; default: boolean }
      title: null
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  { items: ChecklistItem[]; onToggle: (id: string, next: boolean) => void; showProgress: boolean },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see ChecklistProps).

Returns: The checklist 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.4.0

Runtime Dependencies

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

The progress line uses the i18n key checklist.progress ({{done}}, {{total}}), translated by the @molecule/app-locales-checklist companion bond. label/description/title are consumer-provided nodes — pass translated strings via t(). The component is fully controlled: it never mutates completed; persist the toggle in onToggle(id, next) and re-render with updated items.

Translations

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