Skip to content

Card

⋯

Card renders a surface with a 1px border, 16px radius, 12px padding, and 12px gap. The background is neutral by default or gray with variant="gray". Compose headings, text, media, and controls as children.

import { Card } from "@nesra/ui/card";
export function CampaignCard() {
return (
<Card>
<h3>Campaign overview</h3>
<p>Performance this week</p>
</Card>
);
}

Card is also exported from @nesra/ui.

Campaign overview

Performance this week

neutral is the default card background, white in Light and gray-900 in Dark. gray changes only the background.

Neutral

Neutral card background

Gray

Gray card background

Card can wrap content without a prescribed header.

Your report is ready to review.

The AdX Creative Card in Figma uses the default neutral surface and 12px padding. KPI Summary Card uses the gray variant with 4px padding. The example composes an inset panel using semantic tokens. It does not reproduce the KPI icon, checkbox, or trend badge.

Revenue

Last seven days

Rp 999.000.000

Trending up from last week

Native header, dl, and footer elements organize content without adding Card subcomponents.

Campaign summary

This month

Spend
Rp 2.104.677
Conversions
148
Updated today

Button owns the disclosure interaction. Card remains a static container.

Weekly report

Updated this morning

Revenue

Rp 999.000.000

Conversions

1,248

Active campaigns

12

Input and application state filter the list. Card only groups the controls and results.

Reports

  • Campaign overview
  • Creative performance
  • Weekly revenue
3 of 3 reports

The Figma card set does not define a generic size or interaction variant. Thumbnail, metric, checkbox, trend, and tooltip behavior belong to the consuming composition.

Card follows the page theme through .dark or data-theme="dark". The border uses Stroke/stroke-border (--nesra-stroke-border). The neutral background uses Surface/card-bg-neutral (white in Light, gray-900 in Dark), and gray uses Surface/card-bg-gray (gray-50 in Light, gray-800 in Dark). Text inside a card should use the text roles, such as text-nesra-text-body and text-nesra-text-support, so it switches with the card.

Card renders a div without a role or tab stop. Use native headings at the correct level for the page. Give controls and media inside the card their own accessible names and behavior. In the filter example, Input has an accessible name and output announces the result count.

Card accepts native div props, forwards its ref, and exposes data-slot="card" and data-variant. Use className to adjust spacing or override the background. It has no interaction state.

Prop Type Default Effect
variant "neutral" | "gray" "neutral" Sets the card background role.

The visual values come from the color roles, layout scale, and shape and elevation tokens.