انتقل إلى المحتوى
uiify

Badge

Short label for a state, category, or count.

المتصفحات
Chrome 123+Firefox 121+Safari 17.5+
الفئة
0
الحجم المضغوط
201 B
ميزانية التخطيط القسري
0 ms
ميزانية axe
0
متوافق مع SSR
نعم
العقد المنشور
بيئة الاختبار

المختبر

Badge

Ready

أمثلة

Status labels

Use visible words to convey state; color is a supporting cue.

DraftReadyReviewBlocked
import { Badge } from "@gunkin/uiify";

export default function Example() {
  return (
    <>
      <Badge variant="secondary">Draft</Badge>
      <Badge variant="success">Ready</Badge>
      <Badge variant="warning">Review</Badge>
      <Badge variant="destructive">Blocked</Badge>
    </>
  );
}

API

Badge

الخاصيةالنوعافتراضيالوصف
childrenReactNode—Text shown inside the badge.
variant"secondary" | "success" | "warning" | "destructive"—Visual meaning written to data-variant; keep status understandable in text.
size"sm" | "md" | "lg"—Visual scale written to data-size; omitted when unset.
asElementType"span"Native element or component used for the root.
classNamestring—الفئة المطبّقة على العنصر الجذر.
styleCSSProperties—Native root styles.
refRef<HTMLElement>—Ref forwarded to the rendered root element.
renderReactElement | ((props, state) => ReactElement)—استبدل العنصر المعروض مع الحفاظ على توصيلات السلوك وإمكانية الوصول.

لوحة المفاتيح

المفتاحالإجراء

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

Static text marker with no role or keyboard behavior. Keep its meaning in visible words and do not use it as a control.

نقاط التنسيق

data-uiify-badgedata-variantdata-size
تُرجمت هذه الصفحة آليًا ولم تُراجع بعد.