الانتقال إلى المحتوى الرئيسي

نظرة عامة

استخدم TabButton لروابط المسارات والإجراءات، مثل إضافة علامة تبويب أو فتح قائمة الفائض. يتشارك مظهر علامات التبويب ويستخدم الزر للتفاعل.

استخدام

الحالة والدلالات

يوفر تطبيقك active من حالة المسار أو القائمة الحالية. تُبرز هذه الخاصية عنصر التحكم. عيّن aria-current="page" على رابط المسار الحالي. تحتفظ روابط المسارات والإجراءات المجاورة بدلالاتها كروابط أو أزرار، من دون دور علامة تبويب أو aria-selected أو علاقة بلوحة. استخدم Tabs.Root وTabs.List وTabs.Tab وTabs.Panel وTabs.Indicator الاختياري للتبديل بين لوحات المحتوى ذات الصلة. أبقِ عناصر التحكم في المسار والإجراء خارج Tabs.List.

التنقل

عيّن href لعرض رابط أصلي. يمتلك المسار الحالي مظهر active وقيمة aria-current الخاصة به.
للتوجيه من جانب العميل، وفّر رابط الموجّه عبر render، وعيّن nativeButton={false} وrole="link"، ومرّر الوجهة المحلولة باعتبارها href. احتفظ بحالة المسار وخيارات السجل على رابط الموجّه. يجب أن تمرّر الأغلفة المخصصة الخصائص والمرجع الموفَّرين إلى رابطها.
يتحكم nativeButton الصريح في عقد التفاعل حتى عند وجود href. طابقه مع العنصر المعروض فعليًا. تحتفظ الروابط المعطلة بدور الرابط وتمنع التفعيل.

الإجراءات

من دون href، يعرض عنصر التحكم زرًا أصليًا مع type="button". تمرّ السمات الأصلية والمراجع والأنماط وأسماء الفئات ومعالجات الأحداث كما هي. يقبل render عنصرًا أو دالةً تتلقى خصائص Button وحالته. تشير المراجع إلى الزر أو الرابط المعروض فعليًا، بما في ذلك المراجع الموفَّرة على عنصر مركب.
استخدم startIcon وendIcon وbadge للمحتوى الداعم. تكون الصورة الرمزية الممررة إلى موضع الأيقونة للزينة عندما يسمّي النص الوجهة. يحافظ size على عقد حجم Button العام. يأخذ الحجم الصريح الأولوية على حجم ButtonGroup المحيط؛ وإلا فسيكون المكوّن افتراضيًا بحجم sm.

الإزاحة

boolean
افتراضي:"false"
Highlights the current destination or an action associated with the active tab. Does not change the control role.
ReactNode
Content following the label and trailing icon, such as a count.
string | ((state: ButtonState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactNode
Decorative content displayed after the label.
boolean
افتراضي:"false"
Whether the button should be focusable when disabled.
string
Destination URL. Renders a native anchor when render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.
boolean
افتراضي:"true"
Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in href anchor defaults to false; an explicit value takes precedence.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>
Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use nativeButton={false} and role="link" for a custom navigation anchor. Router integration belongs to the caller.
AriaRole
Role of the root element. Use link for custom navigation renderers.
"md" | "sm"
افتراضي:"sm"
Padding of the tab content: sm or md. Explicit size takes precedence over the ButtonGroup size, then sm applies.
ReactNode
Decorative content displayed before the label.
CSSProperties | ((state: ButtonState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.