@molecule/app-note-card-svelte
Feature · note-card · App (browser) · v1.1.5 · Apache-2.0
Sticky-note style card with color, body, optional pin/archive actions
npm install @molecule/app-note-card-svelteHow it works
@molecule/app-note-card-svelte 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.
<script lang="ts">
import { NoteCard } from '@molecule/app-note-card-svelte'
declare function openNote(): void
</script>
<NoteCard
title="Meeting notes"
body="Follow up with design team on the new dashboard layout."
color="#fef9c3"
pinned
modifiedAt="Jun 5, 2026"
onclick={openNote}
/>Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte
Reference
Svelte sticky-note style card — the Svelte counterpart of
@molecule/app-note-card-react, with the same props and the same DOM.
Exports NoteCard — a 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.
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.tsJSDoc, not this file.
Quick Start
<script lang="ts">
import { NoteCard } from '@molecule/app-note-card-svelte'
declare function openNote(): void
</script>
<NoteCard
title="Meeting notes"
body="Follow up with design team on the new dashboard layout."
color="#fef9c3"
pinned
modifiedAt="Jun 5, 2026"
onclick={openNote}
/>
Type
feature
Installation
npm install @molecule/app-note-card-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
API
Interfaces
NoteCardProps
Props for NoteCard.
interface NoteCardProps {
/**
* Note title. A string renders as text; a node arrives as a same-named
* snippet.
*/
title?: Snippet | string
/** Note body text; a node arrives as a snippet. */
body: Snippet | string
/**
* 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 arrives
* as a snippet.
*/
modifiedAt?: Snippet | string
/** Optional right-side actions (edit, archive, delete); arrives as a snippet. */
actions?: Snippet
/**
* 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
const NoteCard: LegacyComponentType
Injection Notes
Requirements
Peer dependencies:
@molecule/app-svelte^3.13.0 || ^4.0.0@molecule/app-ui^1.4.0@molecule/app-ui-svelte^1.6.0svelte^5.0.0
Runtime Dependencies
@molecule/app-svelte@molecule/app-ui@molecule/app-ui-sveltesvelte
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
snippets; strings render as text.
Translations
Translation strings are provided by @molecule/app-locales-note-card.