@molecule/app-oauth-logos-svelte

Feature · oauth-logos · App (browser) · v1.2.0 · Apache-2.0

Canonical OAuth provider brand logos (GitHub, Google, GitLab, Twitter/X, Apple, Facebook, Microsoft, LinkedIn, Discord) as Svelte SVG components — identical across every app regardless of icon bond

npm install @molecule/app-oauth-logos-svelte

npm · Source on GitHub

How it works

@molecule/app-oauth-logos-svelte is a ready-made oauth-logos 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 { getClassMap } from '@molecule/app-ui'
  import { OAuthProviderLogo } from '@molecule/app-oauth-logos-svelte'

  const cm = getClassMap()
</script>

<button class={cm.myButtonChrome}>
  <OAuthProviderLogo provider="github" size={20} />
  <span>Continue with GitHub</span>
</button>

Reference

Canonical OAuth provider brand logos — the Svelte counterpart of @molecule/app-oauth-logos-react, with the same components, the same props and the same rendered DOM.

Ships every logo as a self-contained Svelte 5 SVG component with a normalized 24×24 viewBox and a mode prop ('brand' default — the official multi-color mark — or 'mono' — currentColor for uniform-theme button rows).

Unlike resolving icons through @molecule/app-icons, these logos are bundled inline so every app renders pixel-identical marks regardless of which icon-set bond is wired.

Exports:

  • OAuthProviderLogo — dispatcher (with a fallback snippet).
  • Individual logos: GitHubLogo, GoogleLogo, GitLabLogo, TwitterLogo / XLogo, AppleLogo, FacebookLogo, MicrosoftLogo, LinkedInLogo, DiscordLogo.
  • OAuthProviderId, OAuthLogoProps, OAuthProviderLogoProps types.

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 { getClassMap } from '@molecule/app-ui'
  import { OAuthProviderLogo } from '@molecule/app-oauth-logos-svelte'

  const cm = getClassMap()
</script>

<button class={cm.myButtonChrome}>
  <OAuthProviderLogo provider="github" size={20} />
  <span>Continue with GitHub</span>
</button>

Type

feature

Installation

npm install @molecule/app-oauth-logos-svelte svelte

API

Interfaces

OAuthLogoProps

Props shared by all OAuth provider logo components.

interface OAuthLogoProps {
  /**
   * Rendered size in pixels (applied to both width and height). Defaults to 20.
   *
   * Every logo is authored at a normalized 24×24 viewBox so scaling is
   * identical across providers at any size — the logo's visual weight
   * matches exactly between apps.
   */
  size?: number
  /** Optional className on the outer SVG element. */
  className?: string
  /**
   * Color mode. Defaults to `'brand'` (official multi-color marks).
   * Use `'mono'` to render in `currentColor` — useful for uniform
   * monochrome rows that match the button text color.
   */
  mode?: 'brand' | 'mono'
  /**
   * Accessible label. Defaults to the provider's brand name
   * (e.g., `"GitHub"`, `"Google"`). Pass `''` to mark the logo
   * `aria-hidden` (typical when the button itself has an aria-label).
   */
  ariaLabel?: string
  /** Optional title rendered as `<title>` for hover tooltips. */
  title?: string
}

OAuthProviderLogoProps

Props for OAuthProviderLogo.

interface OAuthProviderLogoProps extends OAuthLogoProps {
  /** The provider whose canonical logo to render. */
  provider: OAuthProviderId | string
  /** Rendered when `provider` has no registered logo (default: nothing). */
  fallback?: Snippet
}

Types

OAuthProviderId

Canonical list of supported providers.

type OAuthProviderId =
  | 'github'
  | 'gitlab'
  | 'google'
  | 'twitter'
  | 'x'
  | 'apple'
  | 'facebook'
  | 'microsoft'
  | 'linkedin'
  | 'discord'

Constants

const AppleLogo: LegacyComponentType
const DiscordLogo: LegacyComponentType
const FacebookLogo: LegacyComponentType
const GitHubLogo: LegacyComponentType
const GitLabLogo: LegacyComponentType
const GoogleLogo: LegacyComponentType
const LinkedInLogo: LegacyComponentType
const MicrosoftLogo: LegacyComponentType
const OAuthProviderLogo: LegacyComponentType
const TwitterLogo: LegacyComponentType
const XLogo: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • svelte ^5.0.0

Runtime Dependencies

  • svelte