@molecule/app-note-card-vue

Feature · note-card · App (browser) · v1.1.4 · Apache-2.0

Sticky-note style card with color, body, optional pin/archive actions

npm install @molecule/app-note-card-vue

npm · Source on GitHub

How it works

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

const App = defineComponent({
  setup() {
    const openNote = (): void => {
      // navigate to the note…
    }
    return () =>
      h(NoteCard, {
        title: 'Meeting notes',
        body: 'Follow up with design team on the new dashboard layout.',
        color: '#fef9c3',
        pinned: true,
        modifiedAt: 'Jun 5, 2026',
        onClick: openNote,
      })
  },
})

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

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

Reference

Vue sticky-note style card.

Exports NoteCard — the Vue counterpart of @molecule/app-note-card-react's NoteCard: the same props (React names), the same ClassMap styling, and 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 { NoteCard } from '@molecule/app-note-card-vue'

const App = defineComponent({
  setup() {
    const openNote = (): void => {
      // navigate to the note…
    }
    return () =>
      h(NoteCard, {
        title: 'Meeting notes',
        body: 'Follow up with design team on the new dashboard layout.',
        color: '#fef9c3',
        pinned: true,
        modifiedAt: 'Jun 5, 2026',
        onClick: openNote,
      })
  },
})

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

Type

feature

Installation

npm install @molecule/app-note-card-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

NoteCardProps

Props for NoteCard.

interface NoteCardProps {
  /**
   * Note title. A string renders as text; a node is passed as a prop or as
   * the same-named slot — both work.
   */
  title?: VNodeChild
  /** Note body text. */
  body: VNodeChild
  /**
   * Background tint (CSS colour). The documented note tints (yellow
   * `#fef9c3`, green `#dcfce7`, blue `#dbeafe`, red `#fee2e2`, amber
   * `#fef3c7`) render as the theme's light tint of their tone; a colour
   * with no tone is data, applied as given.
   */
  color?: string
  /** Optional pin / starred indicator. */
  pinned?: boolean
  /**
   * Optional last-modified display. A string renders as text; a node is
   * passed as a prop or as the same-named slot — both work.
   */
  modifiedAt?: VNodeChild
  /** Optional right-side actions (edit, archive, delete). */
  actions?: VNodeChild
  /**
   * Activates the card: while it is set, an empty, transparent native button
   * covers the whole card and calls this on click — Enter and Space included,
   * natively, since the control is a real button. The button is named by the
   * title when there is one, else the body. The card's other controls (the
   * `actions` slot) sit above that button and keep their own clicks, so they
   * do not fire this.
   */
  onClick?: () => void
  /** Extra classes. */
  className?: string
}

Constants

NoteCard

Sticky-note style card with optional color tint, pinned indicator, and bottom-right actions. Use for note-taking apps, digital post-its, dashboard quick-notes.

The card's paper is a theme tone: the documented note tints (yellow #fef9c3, green #dcfce7, blue #dbeafe, red #fee2e2, amber #fef3c7) render as the theme's light tint of the matching tone, so the card and its text (the theme's ink) follow the app theme. A color with no tone is data: it is applied as given, over the tone's paper. The accessible label of the pin indicator is the string React renders (t('noteCard.aria.pinned', undefined, { defaultValue: 'Pinned' })), read through useTranslation() so it follows a locale switch.

const NoteCard: DefineComponent<
  ExtractPropTypes<{
    title: null
    body: null
    color: { type: StringConstructor; default: undefined }
    pinned: { type: BooleanConstructor; default: undefined }
    modifiedAt: null
    actions: null
    onClick: { type: PropType<NoteCardProps['onClick']>; default: undefined }
    className: { type: StringConstructor; default: undefined }
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      title: null
      body: null
      color: { type: StringConstructor; default: undefined }
      pinned: { type: BooleanConstructor; default: undefined }
      modifiedAt: null
      actions: null
      onClick: { type: PropType<NoteCardProps['onClick']>; default: undefined }
      className: { type: StringConstructor; default: undefined }
    }>
  > &
    Readonly<{}>,
  { onClick: (() => void) | undefined; color: string; pinned: boolean; className: string },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see NoteCardProps).

Returns: The note card component.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.4.0
  • @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

Requires a wired ClassMap bond — getClassMap() throws before wiring.

The card's paper is a theme tone: the documented note tints (yellow #fef9c3, green #dcfce7, blue #dbeafe, red #fee2e2, amber #fef3c7) render as the theme's light tint of the matching tone, so the card and its text (the theme's ink) follow the app theme. A color with no tone is data: it is applied as given, over the tone's paper.

onClick makes the whole card clickable through a transparent native button over it — Enter and Space included, natively — named by the title when there is one, else the body; the card's inner controls (the actions slot) sit above it and keep their own clicks.

Node-valued props (title, body, modifiedAt, actions) arrive as a prop AND a same-named slot; components accept either.

Translations

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