Guides implementation of Twitter Card meta tags for X (Twitter) link previews. Twitter falls back to Open Graph if Twitter-specific tags are missing; add both for best results.
When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
TypeUse casesummarySmall card with thumbnailsummary_large_imageLarge prominent image (recommended; 1200×675px)appMobile app promotionplayerVideo/audio content
html
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Title">
<meta name="twitter:description" content="Your description">
<meta name="twitter:image" content="https://example.com/image.jpg">
<meta name="twitter:site" content="@yourusername">
<meta name="twitter:creator" content="@authorusername">
<meta name="twitter:image:alt" content="Alt text for image">
TagGuidelinetwitter:cardRequired; summary_large_image for most pagestwitter:titleMax 70 chars; concise titletwitter:descriptionMax 200 chars; summarytwitter:imageAbsolute URL; unique per pagetwitter:site@username of websitetwitter:creator@username of content creatortwitter:image:altAlt text; max 420 chars; accessibility
ItemGuidelineAspect ratio2:1Minimum300×157 pxRecommended1200×675 pxMax4096×4096 pxFile sizeUnder 5MBFormatsJPG, PNG, WebP, GIF (first frame only); SVG not supported
tsx
export const metadata = {
twitter: {
card: 'summary_large_image',
title: '...',
description: '...',
images: ['https://example.com/twitter.jpg'],
site: '@yourusername',
creator: '@authorusername',
},
};
html
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Title">
<meta name="twitter:description" content="Your description">
<meta name="twitter:image" content="https://example.com/image.jpg">
<meta name="twitter:site" content="@yourusername">
<meta name="twitter:image:alt" content="Alt text">