MeDo

منشئ الشارات بالذكاء الاصطناعي.

صِف حالاتك ويُنشئ MeDo مجموعة الشارات بالكامل — أقراص حالة دلالية، ووسوم قابلة للإزالة، وعدّادات رقمية مع اختصار 99+، ونقاط مؤشرة تستقر على الصورة الرمزية دون أن تُقتطع.

الشارة
الشارة

الشارة هي أصغر مكوّن، وأكثرها احتمالاً لكسر التصميم

الشارات تعيش داخل أشياء أخرى: خلايا الجداول، صفوف القوائم، عناصر التنقل، العناوين. وهذا يجعل ارتفاعها الأصلي تبعية في التصميم لا مجرد خيار جمالي. الشارة التي يزيد line-height فيها بمقدار بكسل واحد عن النص المجاور ستُمدّد بصمت كل صف في الجدول، وسيُبلَّغ عن الخلل بعبارة «الجدول يبدو خاطئاً» لا كمشكلة في الشارة. تثبيت الشارة على ارتفاع و line-height محددين، بدلاً من ترك الحشو ومقاييس الخط تقرر، هو ما يجعلها آمنة للإدراج في أي مكان. وإنشاء المجموعة كلها مرة واحدة يعني أن كل درجة وكل حجم يتشاركان مقياس الارتفاع ذاته بحكم البناء.

6 قالبًا

قوالب الشارة التي يمكنك توليدها

كل قالب هو طلب حقيقي لا صورة. انسخه إلى أي محرّر ذكاء اصطناعي، أو شغّله في MeDo لتحصل على كود React و Tailwind مباشرة.

BasicStatus Pill

Five-Tone Status Pill

The one you need first. Generating all five tones together is what keeps them on a single height scale, which is what makes the badge safe to drop into a table cell.

Create a status badge with five semantic tones — neutral grey, info blue, success green, warning amber, error red — each pairing a tinted background with a darker text color at 4.5:1 or better. Give it two sizes: sm at 18px tall with 11px text, md at 22px tall with 12px text, both at a 999px radius with 8px horizontal padding, a fixed line-height and inline-flex with align-items center, so a badge dropped into a table cell cannot change the row height. Always render a text label — the tone is redundant encoding, never the only signal. Render it as a span with no tabindex and no role, because a status badge is read-only output and adding a focus stop for it clutters keyboard navigation through a table.

جرّبه في MeDo
NumericCount Badge

Notification Count With 99+ Clamping

A number, a min-width so single digits stay circular, and an announcement when it changes. Without the min-width the badge visibly changes shape as the count crosses from 9 to 10.

Create a numeric count badge that clamps displayed values above 99 to "99+" while keeping the true count in the accessible name. Set min-width equal to the badge height so a single digit renders as a circle rather than a narrow oval, use tabular-nums so the width does not jitter between values, and hide the badge entirely at zero rather than rendering an empty circle. Wrap the count in an element with role="status" and aria-live="polite" so an update is announced without interrupting, and phrase the accessible text as "3 unread messages" rather than a bare numeral. Do not use aria-live="assertive" — a count change almost never justifies cutting off whatever is being read.

جرّبه في MeDo
AnchoredDot Indicator

Dot on an Icon or Avatar

An 8px circle overhanging the corner of a bell or an avatar. The failure is always the same: the wrapper has overflow: hidden for its rounding and clips the dot in half.

Create a dot indicator that anchors to the top-right of an icon or avatar: an 8px circle positioned absolutely with a small negative offset so it overhangs the edge, plus a 2px ring in the page surface color so it stays legible over a photo or a busy icon. Give the wrapper position: relative and explicitly no overflow: hidden — if the wrapper needs rounding, move the border-radius to an inner element so the dot is not clipped. Because a bare dot conveys nothing to a screen reader or a colorblind user, pair it with a visually hidden label naming the state or count. Mark the dot itself aria-hidden="true" so the label is announced once.

جرّبه في MeDo
InteractiveRemovable Tag

Tag Chip With a Dismiss Button

The only variant that is a control rather than output. A dismiss glyph inside a div is why so many UIs ship tags a keyboard user cannot remove.

Create a removable tag chip: a label plus a dismiss control that is a real button element, not a span with a click handler, with aria-label naming the specific tag such as "Remove design" rather than a generic "Remove". Give the button a 16px glyph inside a 24px hit area, a visible focus ring, and Backspace or Delete as an alternative to Enter when it has focus. After removal, move focus to the next remaining chip, or to the group container when the last one is removed, so focus never lands on a detached node. Announce the removal through a polite live region. Keep the chip on the same height scale as the status badge so a row mixing both stays aligned.

جرّبه في MeDo
With iconIcon + Label

Badge With a Leading Status Icon

A 12px glyph before the label for states that need to be identifiable in peripheral vision — a spinner for running, a check for passed, an octagon for failed in a CI list.

Create a badge variant with a 12px leading icon before the label, one distinct glyph per state so severity survives in grayscale: a check for passed, a spinning arc for running, an octagon for failed, a clock for queued. Mark the icon aria-hidden="true" since the label already carries the meaning. Keep the icon optically aligned to the text baseline rather than centered on the line box, and hold the overall badge height identical to the icon-less variant so a mixed column in a table does not develop two row heights. For the running state, drive the spin with a CSS animation and replace it with a static arc under prefers-reduced-motion rather than removing the icon.

جرّبه في MeDo
SubtleOutline Badge

Bordered Badge for Dense Tables

A 1px border with a transparent fill, for screens where a column of tinted pills turns the table into a heat map. Also the variant that survives a dark theme without retinting.

Create an outlined badge variant: a 1px border in the tone color, a transparent background, and label text in the same tone at a darkened step so it holds 4.5:1 against both light and dark surfaces. Match the filled variant on height, radius, padding and line-height exactly, so the two can be swapped per column without any row reflowing — account for the 1px border inside the box by using box-sizing: border-box rather than reducing the padding. Provide a variant prop with filled and outline values on one component rather than a second component. Verify the border remains visible against a hovered table row background, which is the case that usually makes outline badges disappear.

جرّبه في MeDo

كيف تخصّص الشارة الخاص بك

سمِّ الدرجات بالمعنى لا باللون

اطلب success و warning و error بدلاً من الأخضر والكهرماني والأحمر. الأسماء الدلالية تتيح لك إعادة ضبط لوحة الألوان للوضع الداكن أو لتحديث الهوية دون تغيير كل موضع استخدام، وتوضح متى تُستعمل الشارة للتزيين لا للدلالة على حالة.

اقرن اللون بتسمية نصية دائماً

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

حدّد قاعدة الفائض للعدّادات

اذكر ما يحدث فوق الحد الذي تختاره — عادةً الاختصار إلى "99+" — وأعطِ الشارة min-width ليظل العدّاد ذو الرقم الواحد دائرة لا شكلاً بيضاوياً ضيقاً. بدون min-width يتغير شكل الشارة بشكل ملحوظ عند الانتقال من 9 إلى 10.

فرّق بين الشارات الساكنة والوسوم التفاعلية

شارة الحالة نص ولا ينبغي أن تقبل التركيز. الوسم القابل للإزالة عنصر تحكّم ويحتاج زر button حقيقياً لإجراء الإزالة، وحلقة تركيز، واسماً متوافقاً مع الوصول مثل «إزالة التصميم». أخبر MeDo بما تريده وإلا حصلت على div يبدو قابلاً للنقر لكن لا يمكن الوصول إليه بلوحة المفاتيح.

من يستخدم مكوّن الشارة

لوحة تحكم SaaS

عمود حالة في جدول يعرض نشط وقيد الانتظار وفاشل كأقراص ملوّنة على مقياس ارتفاع واحد، بحيث يؤدي تحويل صف من نشط إلى فاشل إلى تغيير اللون والتسمية دون إزاحة الصف.

متجر إلكتروني

أيقونة سلة في الترويسة مع شارة عدّاد مثبّتة في زاويتها العلوية اليمنى ومختصرة إلى "99+"، إضافة إلى أقراص «جديد» و«الكمية محدودة» على بطاقات المنتجات تعيد استخدام نظام الدرجات نفسه.

أداة إدارة مشاريع

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

موقع توثيق

شارات إصدار واستقرار مضمّنة بجانب عناوين واجهة البرمجة — «Beta» و«مهجور» و«v2.1» — مع line-height ثابت حتى لا تُمدّد العنوان الذي تُعلّق عليه.

أنماط الشارة لمواقع مختلفة

المكوّن الشارة نفسه، مُهيّأ لنوع الموقع الذي يُنشر عليه.

01 / 06

SaaS Dashboards

A status column of Active, Pending and Failed pills, where the only thing that matters is that switching a row from one tone to another does not shift the row. Consider the outline variant once the table has more than about ten rows — a full column of tinted fills reads as a heat map.

أنماط الشارة وتنويعاته

اختر التنويعة التي تناسب بقية الصفحة، ثم ولّدها.

01 / 06

Filled Status Pill

A tinted background with darker text at a 999px radius — the default, and the most legible at 11px. Keep the tint light: a saturated fill at this size makes small text harder to read exactly where the label is doing the accessibility work.

الشارة في React و Next.js و Vue و Svelte

React و Next.js و Vue 3 و SvelteKit و Astro أو HTML صِرف — المكوّن الشارة نفسه بست طرق للإضافة.

01 / 06

React Badge

Stateless by definition — a status badge is output, so no hooks and no client boundary. Keep the tone map outside the component so the palette can be retuned in one place instead of at each call site.

src/components/Badge.tsx

const tones = {
  neutral: 'bg-zinc-100 text-zinc-700',
  success: 'bg-emerald-100 text-emerald-800',
  error: 'bg-red-100 text-red-800',
}

export function Badge({ tone = 'neutral', size = 'md', children }) {
  return (
    <span className={`inline-flex items-center rounded-full px-2
      ${sizes[size]} ${tones[tone]}`}>
      {children}
    </span>
  )
}

كيف تضيف الشارة إلى مشروعك

أربع خطوات، من اختيار قالب الشارة إلى إطلاقه في الإنتاج.

01~30s

Pick a Badge Variant

Decide first whether you need output or a control: a status pill and a count are read-only, a tag chip is interactive. Then pick the tone set and the two sizes you actually need.

02~10s

Copy the Prompt

Take it into MeDo, Lovable, Bolt, v0 or Cursor. Name your tones semantically — success, warning, error — not by color, so a rebrand or a dark theme does not mean renaming every usage.

03~1min

Generate and Refine

You get the whole set on one height scale with a live preview. Follow up in plain English — "add an outline variant", "clamp at 999+", "make the dot ring match a dark surface" — instead of nudging padding values.

04~2min

Drop It Into a Table and Check the Row Height

Put a badge in a real table cell and a real heading, then compare row heights against a cell without one. If anything grew, the line-height is not pinned and the fix belongs in the component, not the table.

أسئلة شائعة حول الشارة

كيف أُنشئ مكوّن شارة بالذكاء الاصطناعي؟

صِف الدرجات والأنماط التي تحتاجها في موجه واحد، مثل «خمس درجات حالة دلالية مع شارة عدّاد رقمية ووسم قابل للإزالة بحجمين». يُنشئ MeDo المجموعة كاملة بمقياس ارتفاع ونصف قطر وحشو مشتركة بدل قرص واحد مكتوب بشكل ثابت.

ما الفرق بين الشارة والوسم أو chip؟

الشارة مخرج للقراءة فقط: تُبلّغ عن حالة أو عدد ولا ينبغي أن تقبل التركيز. الوسم أو chip مدخل يمكن للمستخدم التعامل معه، عادةً بإزالته، فيحتاج زر button حقيقياً ونمط تركيز واسماً متوافقاً مع الوصول. معاملتهما كمكوّن واحد هي السبب في أن كثيراً من الواجهات تُطلق وسوماً لا يستطيع مستخدم لوحة المفاتيح إزالتها.

هل يمكن للشارة أن تنقل الحالة باللون وحده؟

لا. يقتضي المعيار WCAG 1.4.1 ألا يكون اللون الوسيلة الوحيدة لنقل المعلومة، لذا تفشل الشارة الحمراء بلا تسمية مع مستخدمي عمى الألوان وقارئات الشاشة. اعرض تسمية نصية، أو أيقونة مع تسمية مخفية بصرياً، إلى جانب الدرجة. ويُدرج MeDo التسمية افتراضياً عندما تصف الدرجات دلالياً.

كيف أعرض عدد إشعارات يتجاوز 99؟

اختصر القيمة المعروضة واعرض "99+" بمجرد تجاوز العدد للحد الذي حددته، مع الإبقاء على الرقم الحقيقي في الاسم المتوافق مع الوصول إن كان مهماً. واقرن الاختصار بـ min-width مساوية لارتفاع الشارة لتبقى العدّادات ذات الرقم الواحد دائرية.

هل ينبغي أن تُعلن شارة العدّاد التغييرات لقارئات الشاشة؟

نعم، عندما يتحدّث العدد دون الانتقال بين الصفحات. ضعه داخل منطقة aria-live="polite" ليُعلن القيمة الجديدة دون مقاطعة المستخدم، وأبقِ النص مقتضباً — «3 غير مقروءة» أفضل من رقم مجرد. تجنّب aria-live="assertive" هنا، فعدد الإشعارات نادراً ما يستحق قطع ما يُقرأ.

كيف أضع شارة نقطة على صورة رمزية دون اقتطاعها؟

أعطِ حاوية الصورة الرمزية position: relative ولا تستخدم overflow: hidden، ثم ضع النقطة بتحديد absolute مع إزاحة سلبية صغيرة لتتجاوز حدود الدائرة. أضف حلقة 2px بلون سطح الصفحة لتبقى النقطة واضحة فوق صورة مزدحمة. وإذا كانت الحاوية تقتطع عناصرها، فانقل التدوير إلى عنصر داخلي.

بناء الشارة الخاص بك الآن.

جرّب أي أمر — مجاني وبدون تسجيل.