@molecule/app-integration-card-vue

Feature · integration-card · App (browser) · v1.1.2 · Apache-2.0

Integration / connection card with icon, status, connect/disconnect action

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

npm · Source on GitHub

How it works

@molecule/app-integration-card-vue is a ready-made integration-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 { defineComponent, h } from 'vue'
import { IntegrationCard } from '@molecule/app-integration-card-vue'

const Integrations = defineComponent({
  setup() {
    return () =>
      h(IntegrationCard, {
        title: 'Slack',
        description: 'Send notifications to your team channels.',
        status: 'disconnected',
        action: {
          label: 'Connect',
          onClick: () => {
            window.location.href = '/oauth/slack'
          },
        },
        dataMolId: 'slack-integration-card',
      })
  },
})

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

Reference

Vue integration / connection card.

Exports <IntegrationCard> — icon + title + description + status label + action button. Props: icon?, title, description?, status? (default 'disconnected'), action? ({ label, onClick?, href?, loading?, disabled? }), variant? ('card' default | 'cta' gradient promo), className?, dataMolId?. It is the Vue counterpart of @molecule/app-integration-card-react: the same props, the same ClassMap tokens, and the same DOM for the same input.

Use for OAuth/API integrations, bank-connect CTAs, webhook setup cards.

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 { defineComponent, h } from 'vue'
import { IntegrationCard } from '@molecule/app-integration-card-vue'

const Integrations = defineComponent({
  setup() {
    return () =>
      h(IntegrationCard, {
        title: 'Slack',
        description: 'Send notifications to your team channels.',
        status: 'disconnected',
        action: {
          label: 'Connect',
          onClick: () => {
            window.location.href = '/oauth/slack'
          },
        },
        dataMolId: 'slack-integration-card',
      })
  },
})

Type

feature

Installation

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

API

Interfaces

IntegrationCardProps

Props for the IntegrationCard component.

interface IntegrationCardProps {
  /**
   * Leading icon / logo for the integration. Passed as a prop or as the
   * same-named slot — both work.
   */
  icon?: VNodeChild
  /** Integration title (a prop or the same-named slot). */
  title?: VNodeChild
  /** Supporting description (a prop or the same-named slot). */
  description?: VNodeChild
  /** Current connection status. Defaults to `'disconnected'`. */
  status?: IntegrationStatus
  /** Action button configuration. */
  action?: {
    /** Button label — passed as a prop or as the same-named slot. */
    label?: VNodeChild
    /** Click handler (receives the DOM click event, as React's handler does). */
    onClick?: (event?: MouseEvent) => void
    /** When set, the button renders inside a plain anchor to this URL. */
    href?: string
    /** While true on the button branch, the label is replaced by an ellipsis glyph. */
    loading?: boolean
    /** Disables the action. */
    disabled?: boolean
  } | null
  /** `'card'` default, `'cta'` for premium gradient-tinted promos. */
  variant?: 'card' | 'cta'
  /** Extra classes. */
  className?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
}

Types

IntegrationStatus

Connection status for an integration.

type IntegrationStatus = 'connected' | 'disconnected' | 'pending' | 'error'

Constants

IntegrationCard

Card for an integration / external connection (Slack, Stripe, Google Drive, bank-link CTAs, etc.). Shows icon + title + description + status + action.

const IntegrationCard: DefineComponent<
  ExtractPropTypes<{
    icon: null
    title: null
    description: null
    status: { type: PropType<IntegrationStatus>; default: string }
    action: { type: PropType<IntegrationCardAction | null>; default: undefined }
    variant: { type: PropType<'card' | 'cta'>; default: string }
    className: StringConstructor
    dataMolId: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      icon: null
      title: null
      description: null
      status: { type: PropType<IntegrationStatus>; default: string }
      action: { type: PropType<IntegrationCardAction | null>; default: undefined }
      variant: { type: PropType<'card' | 'cta'>; default: string }
      className: StringConstructor
      dataMolId: StringConstructor
    }>
  > &
    Readonly<{}>,
  {
    action: {
      label?: VNodeChild
      onClick?: (event?: MouseEvent) => void
      href?: string
      loading?: boolean
      disabled?: boolean
    } | null
    status: IntegrationStatus
    variant: 'card' | 'cta'
  },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see IntegrationCardProps).

Returns: The integration card 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

  • The status label text ('Connected', 'Connecting…', 'Error', 'Not connected') routes through t() under integrationCard.status.*, translated by the @molecule/app-locales-integration-card companion bond. There is no override prop.

  • variant="cta" paints an inline linear-gradient background over the Card using var(--color-primary) (falls back to a fixed blue when the theme token is missing). Inline styles beat ClassMap classes, so this overrides the themed card surface; check text contrast against your primary color before using it.

  • action.href renders an anchor wrapping the Button and ignores action.loading; prefer action.onClick for anything that needs a loading state. While action.loading is true the button label is replaced by an ellipsis glyph.

  • Node-valued props (icon, title, description, action.label) arrive as a prop AND a same-named slot; components accept either.

  • Styling resolves through getClassMap() — wire a ClassMap bond (e.g. @molecule/app-ui-tailwind) before rendering.

Translations

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