MeDo

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

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

زر
زر

تشكّل الأزرار نحو ربع أي نظام تصميم

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

6 قالبًا

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

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

BasicVariant Set

Four Roles, Three Sizes

The set you generate first and edit for a year. Roles rather than colors, so a rebrand moves one token instead of forty class strings.

Create a reusable button component with four role-based variants: primary as a solid brand fill with white text, secondary as a white surface with a grey border, ghost as transparent with a tinted background on hover, and destructive as a solid red. Support sm at 32px tall, md at 40px and lg at 48px, plus a fullWidth prop. Wire hover, active, focus-visible, disabled and loading states for every variant, keeping the focus ring on focus-visible only so mouse clicks do not draw it. Render a real button element with an explicit type attribute, and drive all four variants from one shared spacing and radius scale rather than per-variant values.

جرّبه في MeDo
IconsIcon + Label

Leading and Trailing Icon Slots

Two slots, one gap token. Most icon bugs are spacing bugs — an icon glued to its label, or optically misaligned because the SVG box is taller than the cap height.

Extend a button component with optional leading and trailing icon slots. Size the icon to 16px at sm and md and 18px at lg, set a consistent 8px gap between icon and label, and add aria-hidden="true" to the icon so screen readers announce the label only. Flip the slot order automatically under a right-to-left direction. Use inline-flex with items-center so the icon aligns to the label cap height rather than the line box, and give the SVG shrink-0 so a long wrapping label cannot squash it. Accept any React node so a spinner or an avatar can occupy the same slot.

جرّبه في MeDo
LoadingAsync Submit

Loading Button With a Locked Width

A submit button that shrinks when the spinner replaces the label makes the whole form jump. Reserve the width and the click feels instant instead of broken.

Create a submit button with a loading prop. While loading, replace the label with a centered spinner but keep the button at its resting width by rendering the label at zero opacity underneath the spinner rather than removing it from the DOM. Set aria-busy="true" and aria-disabled="true", block repeat submissions, and keep the button focusable so a screen reader can still read the pending state. Respect prefers-reduced-motion by swapping the rotating spinner for a static pulsing dot. Add an optional loadingText prop that announces progress through a polite live region instead of changing the visible label.

جرّبه في MeDo
ToolbarIcon Only

Square Icon Button With a Tooltip

Dense toolbars need it, and it fails accessibility more often than any other button. No visible text means the accessible name has to come from somewhere explicit.

Create an icon-only button for a dense toolbar: a square target at 32px, 36px and 40px with the icon centered and no label. Require an ariaLabel prop and render it as aria-label on the button, since there is no visible text to name the control. Expand the hit area to at least 44px with a negative-margin pseudo-element so touch targets meet the minimum without widening the toolbar. Pair it with a tooltip that appears on hover and on keyboard focus, referenced with aria-describedby so the tooltip supplements the label rather than replacing it. Include a pressed state driven by aria-pressed for toggle uses.

جرّبه في MeDo
GroupSplit Action

Split Button With a Menu Half

One default action plus a menu of alternates — Save and Save as, Deploy and Deploy to staging. Two buttons that must look like one and stay independently reachable.

Create a split button: a primary action on the left and a narrow chevron trigger on the right, joined into one visual unit with a 1px divider, the outer corners rounded and the inner corners square. Render them as two separate button elements so each keeps its own accessible name, giving the chevron a label such as "More save options". Wire the chevron to a menu with aria-haspopup="menu" and aria-expanded, opening on click and on ArrowDown, closing on Escape with focus returned to the trigger. Keep the focus ring visible on each half by drawing it outside the shared border rather than inside it.

جرّبه في MeDo
PolymorphicLink as Button

Anchor With Button Styling

A styled div with an onClick is not a button and a button that navigates is not a link. One asChild prop keeps the styling while the correct element still ships.

Create a polymorphic button that accepts an asChild prop and forwards its variant, size and state classes onto a child element, so a Next.js Link or a plain anchor can carry button styling without nesting an interactive element inside a button. Forward the ref, merge className rather than overwriting it, and skip the type attribute when the rendered element is not a button. When the target is an anchor, omit the disabled attribute — which anchors ignore — and instead drop href and set aria-disabled with pointer-events none. Add an external variant that appends rel="noopener noreferrer" and a visually hidden "opens in a new tab" note.

جرّبه في MeDo

كيف تخصّص زر الخاص بك

حدّد الأنماط لا الألوان فقط

اطلب الأنماط حسب الدور — primary و secondary و ghost و destructive — بدلاً من اللون. التسمية القائمة على الدور تصمد أمام تغيير الهوية: عندما يتغير لون علامتك يبقى معنى "primary" نفسه ولا يتحرك سوى رمز تصميم واحد.

حدّد حالة التحميل صراحةً

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

اطلب focus-visible لا focus

الحلقة على :focus تظهر مع نقرات الفأرة أيضاً وتبدو كخلل. اطلب :focus-visible ليظهر التركيز لمستخدمي لوحة المفاتيح والتقنيات المساعدة فقط، وهو ما تتحقق منه فعلياً مراجعات إمكانية الوصول.

اضبط دلالات التعطيل

قرّر ما إذا كانت الأزرار المعطّلة ستستخدم خاصية disabled أو aria-disabled. الخاصية تحجب كل الأحداث بما فيها التركيز؛ أما aria-disabled فتُبقي الزر قابلاً للتركيز حتى تتمكن قارئات الشاشة من إعلان سبب عدم توفره. حدّد ما تريد.

من يستخدم مكوّن زر

منتج SaaS

زر رئيسي لدعوة التجربة المجانية، وثانوي لـ "احجز عرضاً توضيحياً"، وشفاف للروابط الفرعية داخل البطاقات، وتدميري لحذف الحساب — جميعها بنفس نصف القطر وحلقة التركيز حتى تُقرأ الواجهة كمنتج واحد.

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

زر "أضف إلى السلة" عالي التباين مع حالة تحميل أثناء التحقق من المخزون، إضافة إلى نمط ثانوي أهدأ لـ "احفظ لوقت لاحق" لا ينافسه على الانتباه.

لوحة تحكم أو أداة إدارة

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

صفحة هبوط تسويقية

زر رئيسي واحد كبير الحجم في أعلى الصفحة، يتكرر في أسفلها، مع نمط شفاف للرابط الثانوي "شاهد كيف يعمل" الذي يُمرّر الصفحة بدلاً من أن يُحوّل.

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

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

01 / 06

SaaS Product Buttons

One primary per screen is the rule that keeps a product feeling directed. Everything else drops to secondary or ghost, and destructive stays reserved for irreversible actions so a red button always means the same thing. The moment two primaries appear in one view, users start reading the layout instead of acting on it.

أنماط زر وتنويعاته

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

01 / 06

Solid Button

A filled surface with white or near-white text, carrying the highest visual weight on the page. Check the contrast against the fill rather than the page background, and remember that a lightened hover state can quietly drop a passing 4.5:1 pairing below the line.

زر في React و Next.js و Vue و Svelte

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

01 / 06

React Button

Derive the class string from variant and size lookups instead of chained ternaries, and forward the ref so tooltips and popovers can anchor to the element. Spread the remaining props last so a caller can still pass type or aria attributes through.

src/components/Button.tsx

export const Button = forwardRef(function Button(
  { variant = 'primary', size = 'md', loading, ...props },
  ref
) {
  return (
    <button
      ref={ref}
      type="button"
      aria-busy={loading}
      className={cn(base, variants[variant], sizes[size])}
      {...props}
    />
  )
})

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

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

01~30s

Pick a Button Template

Scan the six templates and start from the closest surface — the full variant set for a design system, the async submit for a form, the icon-only for a toolbar.

02~10s

Copy the Prompt

Take the prompt into MeDo, Lovable, Bolt, v0 or Cursor. Swap in your brand color, radius and font before you run it, since those three values are what every variant inherits.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "add an xs size", "make the disabled state use aria-disabled" — rather than hand-editing the class lookups.

04~2min

Replace Your Ad-Hoc Buttons

Import one Button and delete the one-off styles it supersedes. The value is in the variants sharing a spacing scale and focus ring by construction, which only holds if nothing else on the page is styling its own button.

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

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

صِف الأنماط والأحجام والحالات التي تحتاجها في موجه واحد — مثل "أنماط primary و secondary و ghost بثلاثة أحجام مع حالات hover و disabled و loading" — ويُنشئ MeDo المكوّن الكامل بكل التوليفات موصولة. تحصل على ملف واحد يغطي المجموعة كلها بدلاً من زر واحد مكتوب بشكل ثابت.

ما أنماط الأزرار التي يحتاجها نظام التصميم؟

معظم المنتجات تحتاج أربعة: primary للإجراء الأهم في الشاشة، و secondary للإجراءات المساندة، و ghost أو الثالثي للإجراءات منخفضة التوكيد داخل الواجهات المزدحمة، و destructive لأي إجراء غير قابل للتراجع. إضافة أنماط أكثر من ذلك تشير عادةً إلى مشكلة في التسلسل الهرمي لا إلى نمط ناقص.

هل يمكن للذكاء الاصطناعي إنشاء أزرار سهلة الوصول؟

نعم. يقدّم MeDo عناصر button حقيقية بخاصية type صريحة، وحلقات focus-visible، وأسماء سهلة الوصول للأزرار ذات الأيقونات فقط، وحالات تعطيل تُعلنها قارئات الشاشة بشكل صحيح. اذكر إمكانية الوصول في موجهك وسيضيف كذلك aria-busy أثناء التحميل.

كيف أضيف حالة تحميل إلى زر؟

اطلب خاصية loading تستبدل التسمية بمؤشر دوّار مع تثبيت عرض الزر، وتُعطّل التفاعل، وتضبط aria-busy حتى تُعلن التقنيات المساعدة الحالة المعلّقة. تثبيت العرض هو الجزء الذي يُنسى — بدونه تُعاد تهيئة الصفحة عند كل نقرة.

هل يجب أن يكون الزر زراً أم رابطاً؟

إن كان ينقل المستخدم إلى صفحة أخرى فيجب أن يكون anchor؛ وإن كان ينفّذ إجراءً فيجب أن يكون button. أخبر MeDo بالسلوك المطلوب وسيقدّم العنصر الصحيح، مع مخرج بنمط asChild عندما تحتاج تنسيق الزر على رابط توجيه.

هل يمكنني إنشاء أزرار تطابق هوية علامتي الحالية؟

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