بطاقة

Card

سطح بطاقة مركّب في React بصورة وأيقونة ورأس ومحتوى وتذييل وأقسام قابلة للتوسيع. أنماط قابلة للاختيار وتفاعلية للوحات التحكّم والبوّابات.

Card مجموعة من الأجزاء. ركب رأسًا ومحتوى وتذييلًا حسب حاجتك.

متى تستخدمه

استخدم Card لتجميع محتوى مترابط في سطح واحد: ملخّص خدمة، أو طلب في قائمة، أو بلاطة في لوحة تحكّم. ركّب الأجزاء التي تحتاجها فقط. اجعل البطاقة تفاعلية حين تقود كلّها إلى وجهة واحدة، وقابلة للاختيار حين يختار المستخدم من بين بطاقات.

تجنّب تداخل البطاقات؛ استخدم Divider أو المسافات داخلها.

أمثلة

بطاقة أساسية

مع أيقونة

الخصائص

الخصائص التي يعرّفها Card. سمات العنصر الأصلي تمرّ كما هي.

<Card>

الخاصيةالنوعالافتراضيالوصف
variant"outline" | "ghost" | "default" | "elevated" | "plain" | "filled" | "gradient"
padding"sm" | "md" | "lg"
orientation"vertical" | "horizontal"
interactiveboolean
align"center" | "start"
asChildbooleanRender as the single child element instead of a <div> (see Button).
disabledbooleanDGA Disabled state - mutes the surface (gray-200 bg / gray-400 text + icon) and marks the card aria-disabled. Suppresses Selectable toggling.
selectablebooleanDGA Type=Selectable - the whole card becomes a checkbox (role="checkbox", Space toggles) with a checkbox indicator at the top inline-end. Controlled via selected or uncontrolled via defaultSelected. Ignores asChild.
selectedbooleanControlled selected state (Selectable).
defaultSelectedbooleanUncontrolled initial selected state (Selectable).
onSelectedChange(selected: boolean) => voidFires with the next selected value when the user toggles a Selectable card.
expandablebooleanDGA Type=Expandable - renders a chevron toggle (icon-only Subtle button) at the bottom inline-end that shows/hides a <CardExpandableContent> region. Controlled via expanded or uncontrolled via defaultExpanded.
expandedbooleanControlled expanded state (Expandable).
defaultExpandedbooleanUncontrolled initial expanded state (Expandable).
onExpandedChange(expanded: boolean) => voidFires with the next expanded value when the user toggles an Expandable card.
expandLabelstringAccessible label for the expand/collapse toggle. Default 'Toggle details'.

<CardIcon>

الخاصيةالنوعالافتراضيالوصف
asChildboolean
featuredbooleanRender the DGA Platforms Code "Featured Icon" treatment - a 48px brand-light circle around the glyph (vs the bare inline icon). Pair with the SDGA Card pattern (featured icon → title → content → footer).
size"md" | "lg"Featured circle size: md 48px / 24px glyph (default) · lg 56px / 28px glyph (stat tiles).

<CardTitle>

الخاصيةالنوعالافتراضيالوصف
asChildbooleanOverride the heading element (e.g. render an <h2> or <a>).

<CardDescription>

الخاصيةالنوعالافتراضيالوصف
asChildboolean
minLinesnumberReserve room for at least this many 24px lines so cards in a row keep one height (the SDGA mobile News card draws four).
clampnumberTruncate after this many lines with an ellipsis.

<CardImage>

الخاصيةالنوعالافتراضيالوصف
aspectRatiostringAspect ratio of the image in vertical orientation (e.g. '16/9', '4/3', '1/1'). Default '16/9', or 'auto' when blockSize is set. Ignored in horizontal orientation, where the image fills the card's full height.
blockSizestring | numberFixed height in px or any CSS length (the SDGA image slot is 250 tall).

إمكانية الوصول

البطاقة العادية حاوية عامة بلا دور. تعرض البطاقات التفاعلية role="button" وتستجيب لـ Enter، وتعرض البطاقات القابلة للاختيار role="checkbox" مع aria-checked. يربط المحتوى القابل للتوسيع مشغّله بـ aria-expanded وaria-controls.

أعطِ البطاقة عنوانًا عبر CardTitle ليتنقّل مستخدم قارئ الشاشة بالعناوين.