@molecule/app-address-display-vue

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

Formatted multi-line address card with edit/delete actions

npm install @molecule/app-address-display-vue

npm · Source on GitHub

How it works

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

createApp(
  defineComponent({
    setup() {
      return () =>
        h(AddressDisplay, {
          name: 'Jane Smith',
          address: {
            line1: '123 Main St',
            city: 'Springfield',
            state: 'IL',
            postalCode: '62701',
            country: 'US',
          },
          phone: '+1 555-867-5309',
        })
    },
  }),
).mount('#app')

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

Reference

Vue formatted address display.

Exports <AddressDisplay> — formatted multi-line (or inline) address with name, phone, leading icon, and action slots. Also exports the Address type. It is the Vue counterpart of @molecule/app-address-display-react: the same props (React names) 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 { AddressDisplay } from '@molecule/app-address-display-vue'

createApp(
  defineComponent({
    setup() {
      return () =>
        h(AddressDisplay, {
          name: 'Jane Smith',
          address: {
            line1: '123 Main St',
            city: 'Springfield',
            state: 'IL',
            postalCode: '62701',
            country: 'US',
          },
          phone: '+1 555-867-5309',
        })
    },
  }),
).mount('#app')

Type

feature

Installation

npm install @molecule/app-address-display-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

Address

Structured postal address with optional individual fields.

interface Address {
  /** First line — street + number. */
  line1?: string
  /** Second line — apartment, suite, unit. */
  line2?: string
  /** City. */
  city?: string
  /** State / province / region. */
  state?: string
  /** ZIP / postal code. */
  postalCode?: string
  /** Country. */
  country?: string
}

AddressDisplayProps

Props for AddressDisplay.

interface AddressDisplayProps {
  /** Address fields. */
  address: Address
  /** Optional name / label preceding the address. Passed as a prop or as the same-named slot. */
  name?: VNodeChild
  /** Optional phone number rendered under the address. */
  phone?: string
  /** Optional `<Icon>` / avatar leading slot. Passed as a prop or as the same-named slot. */
  leading?: VNodeChild
  /** Optional right-side actions. Passed as a prop or as the same-named slot. */
  actions?: VNodeChild
  /** Format as a single line instead of multi-line. */
  inline?: boolean
  /** Extra classes. */
  className?: string
}

Constants

AddressDisplay

Formatted multi-line address display with optional name, phone, leading slot, and right-side actions. Set inline to render all fields on a single line (e.g., in a table cell).

The name, leading and actions are node-valued props: pass them as a prop or as the same-named slot — both work.

const AddressDisplay: DefineComponent<
  ExtractPropTypes<{
    address: { type: PropType<Address>; required: true }
    name: null
    phone: { type: StringConstructor; default: undefined }
    leading: null
    actions: null
    inline: { type: BooleanConstructor; default: undefined }
    className: { type: StringConstructor; default: undefined }
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      address: { type: PropType<Address>; required: true }
      name: null
      phone: { type: StringConstructor; default: undefined }
      leading: null
      actions: null
      inline: { type: BooleanConstructor; default: undefined }
      className: { type: StringConstructor; default: undefined }
    }>
  > &
    Readonly<{}>,
  { phone: string; inline: boolean; className: string },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see AddressDisplayProps).

Returns: The address display 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

  • Requires a bonded ClassMap — rendering throws otherwise. No i18n or router dependency.

  • The name, leading and actions are node-valued props: pass a value or the same-named slot, and the slot wins when both are given.