npm.io
10.3.6 • Published yesterday

@tryghost/kg-default-cards

Licence
MIT
Version
10.3.6
Deps
7
Size
339 kB
Vulns
0
Weekly
0
Stars
55.3K

Koenig Default Cards

Mobiledoc card definitions for Ghost's editor.

Legacy: this package supports posts that have never been converted from Mobiledoc. New editor work belongs in the Lexical packages.

Install

npm install @tryghost/kg-default-cards

Usage

import {cards} from '@tryghost/kg-default-cards';

cards.map(card => card.name);
// ['bookmark', 'code', 'email', 'email-cta', 'embed', ...]

Each card exposes name, type and a render function, ready to hand to the Mobiledoc renderer. Cards that contain URLs also expose the relevant transform helpers (absoluteToRelative, relativeToAbsolute, toTransformReady) that Ghost applies when storing and serving content.

Develop

This package is part of the Ghost monorepo and resolves through the pnpm workspace — there is no linking or per-package install step. Run pnpm bootstrap in the monorepo root, then work in koenig/kg-default-cards.

See the Koenig README for the shared build, test and release workflow.

Test

  • pnpm test:unit runs the unit tests
  • pnpm test runs the unit and type tests, including coverage thresholds
  • pnpm lint runs the lint checks

Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.