AI卡片生成器。

描述卡片承載的內容,MeDo即可生成完整容器 — 媒體、標題、內文與頁腳插槽,懸停浮起效果,以aspect-ratio鎖定的圖片,格線中的等高排列,以及配套的骨架狀態。

卡片
卡片

卡片是一份版面契約,而非帶邊框的盒子

圓角與陰影一分鐘便能寫好,所以卡片常被當作微不足道的小東西。真正出問題的是它周圍的一切。一張卡片標題兩行,旁邊那張四行,頁腳就再也對不齊。圖片以意料之外的比例回傳,格線在繪製之後重新回流。有人把整張卡片做成可點擊,卻把「儲存」按鈕困在 anchor 內部,產生無效的HTML與無法觸及的控制項。這些是卡片置於集合中時的特性,而非單張卡片的特性。正因如此,把容器、媒體約束、頁腳對齊與載入狀態當作一個整體生成,比把單一 div 的樣式寫得漂亮更有價值。

6 個模板

可以產生的 卡片 模板

每個模板都是真實的提示詞,而非截圖。複製到任何 AI 編輯器,或在 MeDo 中執行,直接取得 React + Tailwind 程式碼。

BasicSlots + Skeleton

Four-Slot Card With a Matching Skeleton

The container everything else extends. Generating the skeleton in the same pass is what keeps the two the same size six months later.

Create a card component with four optional slots: media at the top, a header with title and subtitle, a body for description text, and a footer for actions or metadata. White surface, 12px radius, 1px light grey border, 20px internal padding. Make the card a flex column with the body allowed to grow so the footer sits at the bottom and cards in a row stay equal height regardless of title wrapping. Lock the media to a 16:9 ratio with object-fit cover and explicit dimensions. Include a skeleton variant whose grey blocks match the real layout exactly — same media ratio, same line count, same footer height — so nothing shifts when data arrives.

在 MeDo 中試試
CommerceProduct Card

Image, Price and Add to Cart

The hardest card to get right because it needs a whole-card link and a nested button. Wrap the card in an anchor and the button becomes invalid markup and unreachable.

Create a product card: a 1:1 image with object-fit cover and a reserved box, an optional discount badge in the top-left, the product name over two lines with a line clamp, a price row with the current price and a struck-through original, a star rating with a review count, and an Add to cart button in the footer. Make the whole card navigate to the product page by putting the anchor on the product name and stretching it over the card with an absolutely positioned pseudo-element, then raise the cart button above it with a higher z-index so both targets work. Add an out-of-stock state that dims the image and swaps the button for a Notify me control.

在 MeDo 中試試
EditorialArticle Card

Cover Image, Headline and Byline

One headline wraps to two lines and its neighbor to four. Without a growing body the bylines end up on different baselines and the whole index looks unfinished.

Create an article card: a 16:9 cover image with a reserved aspect box, a category badge, a headline clamped to two lines, an excerpt clamped to three, and a footer row with an author avatar, author name, publish date and read time. Make it a flex column with the excerpt allowed to grow so bylines align across a row of cards with different headline lengths. Put the anchor on the headline and stretch it across the card so the accessible name is the headline rather than "read more". Add a featured variant that spans two grid columns with the media on the left and the text on the right.

在 MeDo 中試試
DashboardMetric Card

Stat Card With Delta and Sparkline

No media, all typography. The number is the component, so lock its width with tabular figures or the whole row twitches on every poll.

Create a metric card for a dashboard: a small uppercase label, a large numeric value using tabular figures so the width does not jitter as the number updates, a change indicator showing the delta with an arrow and a green or red tint, and an optional sparkline across the bottom. Never rely on color alone for direction — pair the tint with an arrow glyph and a visually hidden "up" or "down". Reserve the sparkline height even before data arrives. Include a loading variant that shows a shimmering block at the exact value height, and an empty state reading "No data yet" rather than a zero that looks like a real measurement.

在 MeDo 中試試
ConversionPricing Card

Plan Card With a Highlighted Tier

Three cards that must end on one line. If the highlighted tier gets a thicker border, compensate with padding or it will sit one pixel taller than its neighbors.

Create a pricing card: plan name, price with a billing period suffix, a one-line positioning sentence, a feature list with check icons, and a call-to-action button pinned to the bottom. Add a highlighted variant with a thicker border, a "Most popular" badge overlapping the top edge, and reduced internal padding so the extra border width does not make it taller than the adjacent cards. Make the card a flex column with the feature list growing, so buttons across three plans of different feature counts land on the same line. Keep the price in tabular figures and mark the currency and period as separate spans for annual and monthly toggling.

在 MeDo 中試試
InteractiveClickable Card

Whole-Card Link With Nested Controls

The pattern that fixes the most common card bug. One stretched anchor, real controls layered above it, no interactive element nested inside another.

Create a fully clickable card that stays valid HTML: put a single anchor on the card title and expand it over the whole card with an absolutely positioned ::after pseudo-element covering the container, rather than wrapping the card in an anchor. Give the container position relative and any nested control — a bookmark toggle, an overflow menu, a secondary link — a higher z-index plus position relative so it remains clickable. Drive the hover elevation from the container so hovering anywhere raises the card, and mirror it on focus-within so keyboard users see the same state. Skip the translate transform when prefers-reduced-motion is set and keep the shadow change.

在 MeDo 中試試

如何自訂你的 卡片

鎖定媒體的aspect-ratio

為圖片區域明確指定 aspect-ratio 並配合 object-fit cover。若沒有預留盒子,尺寸各異的圖片會在載入後重新調整卡片大小,直接損害 Cumulative Layout Shift,也是卡片格線中最顯眼的瑕疵。

把頁腳固定在最底部

聲明卡片為縱向 flex 排列且內文可以伸展,這樣即使標題折行數不同,同一列的頁腳也能對齊。參差不齊的操作列,是令原本整潔的格線顯得未完成的最快方法。

只選擇一種點擊策略

要麼整張卡片是連結,要麼內部元素是連結,絕不能同時存在。若要整卡可點擊,請在標題上使用單個 anchor,並以絕對定位的偽元素鋪滿卡片,這樣無障礙名稱仍有意義,也為上層的嵌套控制項留出空間。

讓骨架與卡片一起生成

要求載入變體的灰色區塊與真實尺寸一致,包括媒體比例與文字行數。尺寸不同的骨架毫無意義,因為資料抵達的那一刻版面照樣會跳動。

誰在使用 卡片 組件

電商商品格線

正方形商品圖、名稱、價格與評分列,頁腳的「加入購物車」按鈕置於通往商品頁的整卡連結之上,兩個點擊目標都能正常運作且無需嵌套。

網誌或資源列表

16:9封面圖、分類標籤、折成兩行的標題、摘要,以及無論標題多長都能在整列對齊的作者與閱讀時間頁腳。

SaaS儀表板

完全沒有媒體區的指標卡片:標籤、大號數值、變化指示器與迷你折線圖,在查詢完成前的首次繪製中以骨架呈現。

價格或方案比較

三張等高卡片,其中一張以較粗的邊框與標籤突出顯示,每張都以固定於底部的行動呼籲按鈕結尾,令按鈕排在同一條線上。

不同網站的 卡片 方案

同一個 卡片 組件,針對它所在網站的類型作調整。

01 / 06

SaaS Dashboard Cards

Metric cards with no media at all, so the number carries the whole layout. Use tabular figures and reserve the value height, because a card grid fed by a polling query will otherwise reflow every few seconds. Borders beat shadows here — twelve elevated cards on one screen read as noise rather than hierarchy.

卡片 的風格與變體

挑選與頁面其餘部分相襯的變體,然後產生它。

01 / 06

Bordered Card

A 1px border, no shadow. The right default for dense interfaces — tables, dashboards, settings panels — where every card needs an edge but none of them should appear to float. Keep the border one step darker than the divider color or the card dissolves into the page.

在 React、Next.js、Vue 與 Svelte 中使用 卡片

React、Next.js、Vue 3、SvelteKit、Astro 或純 HTML —— 同一個 卡片,六種接入方式。

01 / 06

React Card

Expose the slots as subcomponents — Card.Header, Card.Body, Card.Footer — rather than as props, so a metric card can omit the media without passing null. No state means no hooks, which is what lets you render sixty of them in a grid.

src/components/Card.tsx

export function Card({ className, ...props }) {
  return (
    <div
      className={cn(
        'flex flex-col rounded-xl border bg-white p-5',
        'transition-shadow hover:shadow-lg',
        className
      )}
      {...props}
    />
  )
}
Card.Footer = ({ children }) => <div className="mt-auto pt-4">{children}</div>

如何把 卡片 加入專案

四個步驟,從挑選 卡片 模板到推上生產環境。

01~30s

Pick a Card Template

Scan the six templates and start from the content you are displaying — product with a cart button, article with a byline, metric with a delta, or pricing tier.

02~10s

Copy the Prompt

Take the prompt into MeDo, Lovable, Bolt, v0 or Cursor. Say what grid the card lives in before you run it, because the column count is what determines the media ratio and the equal-height rules.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "clamp the title to two lines", "swap the shadow for a border", "add the skeleton" — instead of editing the flex utilities by hand.

04~2min

Drop It Into the Grid

Render it inside a CSS grid so rows stretch to match, then check a row where one title wraps and another does not. That is the case that reveals whether the footer is actually pinned.

關於 卡片 的常見問題

如何用AI生成卡片元件?

描述卡片包含什麼以及將如何使用,例如「商品卡片,含方形圖片、標題、價格與加入購物車頁腳,用於三欄格線」。MeDo會一併生成插槽結構、媒體約束與懸停狀態。提到格線很重要,因為它決定了等高規則與 aspect-ratio 規則。

卡片元件由哪些部分組成?

四個區域幾乎涵蓋所有情境:可選的媒體區、包含標題及輔助文字的頭部、承載描述內容的內文區,以及放置操作或中繼資料的頁腳。把它們視為可選插槽而非必需標記,一個元件便能同時擔任商品卡片、文章卡片與指標卡片,無需為每種情況單獨做變體。

整張卡片可以點擊嗎?

可以,但若卡片內含按鈕或其他連結,就不要用 anchor 包裹整張卡片,因為嵌套互動元素屬於無效HTML,瀏覽器的處理方式亦難以預測。把 anchor 放在標題上,以絕對定位的偽元素鋪滿卡片,再用更高的 z-index 把嵌套控制項抬到它之上。

如何令格線中的卡片等高?

使用 CSS grid,它本身便會把同一列的項目拉伸至一致高度;同時把卡片自身設為縱向 flex 排列,讓可伸展的內文把頁腳推下去。固定高度是錯誤做法,因為只要有一個標題多折一行,內容便會被裁切。

卡片應該用陰影還是邊框?

在儀表板、表格這類資訊密集的介面中,邊框更易讀,過多陰影會造成視覺雜訊。陰影適合留白充裕的市場推廣版面,令卡片從背景中浮起。選定其中一種作為預設,把另一種留給強調或抬升的變體,而不是在同一層級混用。

卡片需要載入骨架嗎?

任何由網絡請求驅動的卡片都會受益,因為按真實內容尺寸設計的骨架能避免資料抵達時版面回流。在生成卡片的同一個提示詞中要求骨架,兩者會在結構上共用尺寸;分開撰寫時這一點很難長期維持。