نظرة عامة
يجمعInlineBanner بين اللافتة وتخطيط مضمن بحواف مستديرة وأيقونة معلومات زخرفية. يتشارك عقود status وvariant وcolor وicon وaction المستقلة الخاصة بـ Banner. مظهره الافتراضي هو soft وحالته الافتراضية هي info.
استخدام
standard العرض المتاح. تُقتطع العناصر الفرعية للنص العادي، مع إظهار النص الكامل في تلميح عند التركيز باستخدام لوحة المفاتيح أو تمرير المؤشر أو اللمس. تُعرَض العناصر الفرعية للعُقد الغنية مباشرةً، لذا تحتفظ الروابط وعناصر التحكم المضمّنة بدلالاتها الخاصة. استخدم تنسيقًا طباعيًا صريحًا عندما يحتاج المحتوى الغني إلى اقتطاع.
استخدم layout="compact" للمحتوى الملتفّ، والتباعد الأقرب، وعرض محتوى أقصى يبلغ 512px. أضف fullWidth لإزالة ذلك الحد وملء العرض المتاح للعنصر الأب، بما في ذلك الحشو والحدود. تكون قيمته الافتراضية false ولا يغيّر التخطيط القياسي الذي يملأ عنصره الأب بالفعل. لا يحتوي على هامش سفلي. التخطيط مستقل عن مظهرَي solid أو soft. يزيل embedded الهامش السفلي للتخطيط القياسي.
InlineBanner.Action زرًا صغيرًا بإطار يرث اللون المعروض للشعار، بما في ذلك تجاوزات لوحة الألوان الصريحة والمظاهر الصلبة. يدعم تفاعلات Button والروابط وrefs والعرض المخصص. يقبل موضع action أيضًا عناصر تحكم عشوائية.
الهدف الجذر هو div. تستهدف الخصائص الأصلية وclassName وstyle وref ذلك الجذر؛ ويمكن لـ Base UI render إنشاء عنصر آخر ويتلقى حالة Banner المحلولة. يقبل action أي ReactNode، بما في ذلك عناصر تحكم متعددة بواجهات Button أو الرابط الكاملة الخاصة بها. يزيل icon={null} الرمز الافتراضي.
يتحكم المستدعي في ما إذا كان الشعار يُعرض وما إذا كان ينبغي الإعلان عن التغييرات. وفّر role="status" وaria-live="polite"، أو غلاف منطقة مباشرة مناسبًا، عند الحاجة. لا يعيّن Status دلالات المنطقة المباشرة. سمِّ عناصر تحكم الإجراءات، وعلّم الرموز المخصصة الزخرفية باستخدام aria-hidden.
الترحيل
استبدلmessage بـ children، وLeftIcon={Icon} بـ icon={<Icon />}، وإعدادات button بعقدة action. استخدم InlineBanner.Action للحفاظ على محاذاة تنسيق الإجراء مع الشعار. استبدل variant="compact" بـ layout="compact"؛ إذ أصبح التخطيط القياسي هو التخطيط الافتراضي الآن. استخدم status="error" لمعنى الخطأ أو color="red" لتجاوز لوحة الألوان.
الخصائص
ReactNode
Optional trailing ReactNode. InlineBanner.Action supplies the shared banner action preset and inherits the resolved banner color; arbitrary controls are also accepted.
ReactNode
Caller-provided content. Standard plain strings truncate with a focusable tooltip; rich nodes render directly. Compact content wraps.
string
Class merged onto the root div or composed element.
"blue" | "gray" | "green" | "orange" | "red"
افتراضي:"status palette"
Gray, blue, green, orange or red palette override. An omitted color follows status.
boolean
افتراضي:"false"
Removes the standard bottom margin. Compact layouts have no bottom margin.
boolean
افتراضي:"false"
Fills the available parent width, including padding and borders, and removes the compact layout’s 512px maximum. Defaults to false; standard layout already fills its parent.
ReactNode
افتراضي:"decorative information icon"
Leading ReactNode. Defaults to a decorative information icon. Pass null to omit it.
"compact" | "standard"
افتراضي:"standard"
Standard full-width layout or compact wrapping layout with a 512px maximum content width. Defaults to standard.
Ref<HTMLDivElement>
Ref to the root div, or to the DOM element supplied through render.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, BannerState>
Base UI root element or render callback, receiving native props/ref and resolved Banner state.
"error" | "info" | "neutral" | "success" | "warning"
افتراضي:"info"
Feedback meaning: neutral, info, success, warning or error. Defaults to info. Roles and announcements remain caller-owned.
CSSProperties
Inline styles applied to the root div or composed element.
"soft" | "solid"
افتراضي:"soft"
Solid or soft appearance, independently of status and layout. Defaults to soft.
InlineBanner.Action
string | ((state: ButtonState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
boolean
Adds a shadow and backdrop blur. Neutral outline buttons also use elevated surface colors.
ReactNode
Decorative content displayed after the label.
boolean
افتراضي:"false"
Whether the button should be focusable when disabled.
boolean
Expands the button to fill its container width.
string
Destination URL. Renders a native anchor when
render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.boolean
Shows a loading indicator and disables activation.
"center" | "end" | "start"
Where the loading indicator appears.
center hides the content while preserving its layout space; start and end keep children and the opposite icon visible and replace the corresponding icon with the spinner.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.ShortcutDefinition
Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.
string
Localized text between sequence steps. Defaults to then.
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.