@molecule/app-integration-card-svelte

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

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

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

npm · Source on GitHub

How it works

@molecule/app-integration-card-svelte 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.

<script lang="ts">
  import { IntegrationCard } from '@molecule/app-integration-card-svelte'
</script>

<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-svelte, @molecule/app-ui, @molecule/app-ui-svelte

Reference

Svelte integration / connection card — the Svelte counterpart of @molecule/app-integration-card-react, with the same props and the same DOM for the same input.

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?.

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

<script lang="ts">
  import { IntegrationCard } from '@molecule/app-integration-card-svelte'
</script>

<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-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

IntegrationCardProps

Props for the IntegrationCard component.

interface IntegrationCardProps {
  /** Leading icon / logo — a snippet or a plain string. */
  icon?: Snippet | string
  /** Integration title — a snippet or a plain string. */
  title?: Snippet | string
  /** Supporting description — a snippet or a plain string. */
  description?: Snippet | string
  /** Current connection status. Defaults to `'disconnected'`. */
  status?: IntegrationStatus
  /** Action button configuration. */
  action?: {
    /** Button label — a snippet or a plain string. */
    label?: Snippet | string
    /** 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

const IntegrationCard: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.13.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.1.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte

  • @molecule/app-ui

  • @molecule/app-ui-svelte

  • svelte

  • 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) are snippets or plain strings.

  • 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.