@molecule/app-medication-row-svelte
Feature · medication-row · App (browser) · v1.1.3 · Apache-2.0
Medication row — name, dosage, form, instructions, refills remaining, prescriber
npm install @molecule/app-medication-row-svelteHow it works
@molecule/app-medication-row-svelte is a ready-made medication-row 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 { MedicationRow } from '@molecule/app-medication-row-svelte'
</script>
<MedicationRow
name="Lisinopril"
dosage="10mg"
form="tablet"
color="#4ade80"
instructions="Take with water in the morning"
prescriber="Dr. Sarah Chen"
supplyDays={14}
refills={2}
>
{#snippet actions()}
<button type="button">Mark taken</button>
{/snippet}
</MedicationRow>Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte
Reference
Svelte medication record row — drug name + dosage/form, instructions, prescriber, days-of-supply and refills-remaining readouts, optional pill-color dot and right-side actions.
Exports MedicationRow — the Svelte counterpart of
@molecule/app-medication-row-react's MedicationRow: 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.tsJSDoc, not this file.
Quick Start
<script lang="ts">
import { MedicationRow } from '@molecule/app-medication-row-svelte'
</script>
<MedicationRow
name="Lisinopril"
dosage="10mg"
form="tablet"
color="#4ade80"
instructions="Take with water in the morning"
prescriber="Dr. Sarah Chen"
supplyDays={14}
refills={2}
>
{#snippet actions()}
<button type="button">Mark taken</button>
{/snippet}
</MedicationRow>
Type
feature
Installation
npm install @molecule/app-medication-row-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
API
Interfaces
MedicationRowProps
Props for the MedicationRow component.
interface MedicationRowProps {
/** Drug name — a snippet or a plain string. */
name?: Snippet | string
/** Dosage display ("10mg", "1 tablet") — a snippet or a plain string. */
dosage?: Snippet | string
/** Form (tablet, capsule, liquid, etc.) — a snippet or a plain string. */
form?: Snippet | string
/** Optional accent color (typically used to differentiate pill colors). */
color?: string
/** Instructions text ("Take with food") — a snippet or a plain string. */
instructions?: Snippet | string
/** Prescriber display — a snippet or a plain string. */
prescriber?: Snippet | string
/** Days of supply remaining. */
supplyDays?: number
/** Refills remaining. */
refills?: number
/** Right-side actions (Mark taken, Refill, Edit) — a snippet. */
actions?: Snippet
/** Extra classes. */
className?: string
}
Constants
MedicationRow
const MedicationRow: LegacyComponentType
Injection Notes
Requirements
Peer dependencies:
@molecule/app-svelte^3.14.0@molecule/app-ui^1.0.1@molecule/app-ui-svelte^1.6.0svelte^5.29.0
Runtime Dependencies
-
@molecule/app-svelte -
@molecule/app-ui -
@molecule/app-ui-svelte -
svelte -
The "Prescribed by" / "N day supply" / "N refills" labels route through
t()under themedication.prefix. The companion@molecule/app-locales-medication-rowbond currently ships onlymedication.prescribedBy—medication.supplyDaysandmedication.refillsfall back to English until the bond gains them. -
Fields you pass are rendered as-is (snippets or strings) — format dosage/dates and translate free text yourself.
-
No
data-mol-idprop. Renders insideCardfrom@molecule/app-ui-svelte; a ClassMap bond must be wired. -
Node-valued props (
name,dosage,form,instructions,prescriber,actions) are snippets or plain strings.
Translations
Translation strings are provided by @molecule/app-locales-medication-row.