@molecule/app-checklist-svelte

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

Onboarding checklist with checkable items + progress bar

npm install @molecule/app-checklist-svelte

npm · Source on GitHub

How it works

@molecule/app-checklist-svelte 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.

<script lang="ts">
  import { Checklist, type ChecklistItem } from '@molecule/app-checklist-svelte'

  let items = $state<ChecklistItem[]>([
    { 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 },
  ])
</script>

<Checklist
  title="Getting started"
  {items}
  onToggle={(id, next) => {
    items = items.map((item) => (item.id === id ? { ...item, completed: next } : item))
  }}
/>

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

Reference

Svelte onboarding checklist with checkboxes and overall progress bar.

Exports Checklist and the ChecklistItem type. It is the Svelte 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

<script lang="ts">
  import { Checklist, type ChecklistItem } from '@molecule/app-checklist-svelte'

  let items = $state<ChecklistItem[]>([
    { 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 },
  ])
</script>

<Checklist
  title="Getting started"
  {items}
  onToggle={(id, next) => {
    items = items.map((item) => (item.id === id ? { ...item, completed: next } : item))
  }}
/>

Type

feature

Installation

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

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 snippet. */
  label: string | Snippet
  /** Optional description / hint shown under the label: text, or a snippet. */
  description?: string | Snippet
  /** 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: text, or a snippet. */
  title?: string | Snippet
  /** Extra classes on the outer wrapper. */
  className?: string
}

Constants

Checklist

const Checklist: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.5.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.1.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte
  • @molecule/app-ui
  • @molecule/app-ui-svelte
  • svelte

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(), or a snippet for markup. The component is fully controlled: it never mutates completed; persist the toggle in onToggle(id, next) and pass updated items again.

Translations

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