نظرة عامة
يجمعCallout بين عُقد العنوان والوصف والأيقونة والإجراء. استخدم status للقيم neutral أو info أو success أو warning أو error. تكون القيمة الافتراضية هي info، ويدعم المظهر soft. تحدد الحالة لوحة ألوان رمادية أو زرقاء أو خضراء أو برتقالية أو حمراء؛ وتتجاوز color تلك اللوحة دون تغيير المعنى.
استخدام
خيارات مرئية
قارن الحالات الدلالية باستخدام المحتوى نفسه. اختر حالة لمعنى الرسالة، ولا تتجاوز اللون إلا عندما يتطلب التصميم المحيط ذلك.إشعار قابل للإغلاق
الإخفاء والتسميات
يؤدي تمريرonDismiss إلى إظهار زر إغلاق متاح. يستدعي كل تنشيط بالمؤشر أو لوحة المفاتيح هذه الدالة مرة واحدة. يبقى مربع التنبيه معروضًا إلى أن يخفيه المستدعي. احذف onDismiss للحصول على رسالة دائمة. تكون القيمة الافتراضية لـ closeLabel هي Close.
يمتلك تطبيقك المحتوى والإجراءات والأسماء المتاحة والترجمات. استخدم Callout.Action للحصول على زر شفاف صغير بوزن خط عادي. يقبل خصائص Button، بما في ذلك سمات الرابط وحالة التعطيل والمراجع والعرض المخصص؛ ويكون الحجم والمظهر ثابتين. تقبل خانة الإجراء أيضًا أزرارًا مخصصة أو روابط أو عناصر تحكم معطلة أو عقدًا متعددة. أيقونة المساعدة الافتراضية زخرفية؛ مرر icon={null} لحذفها أو وفّر عقدة بدلالات إتاحة مناسبة. لا يتطلب Twenty موفر i18n.
التكامل الأصلي
تستهدف السمات الأصلية وclassName وstyle وref عنصر div الجذر. استخدم render لتكوين عنصر جذر مختلف أو دالة رد تتلقى خصائص الجذر و{ status, variant, color }. يمثل title وdescription خانات محتوى. يزيل fullWidth الحد الأقصى الافتراضي للعرض البالغ 512px.
لا يضيف المكون أي دور لمنطقة مباشرة أو إعلانات. وفّر role وaria-live الأصليين وسمات الإتاحة الأخرى عندما يتطلبها سير العمل المحيط.
الترحيل
استبدلvariant الدلالي السابق بـ status، وIcon الخاص بالمنشئ بعقدة icon. استبدل كائنات الإجراء { label, onClick } بـ Callout.Action أو عناصر تحكم مخصصة. استبدل isClosable وonClose بـ onDismiss، واعرض مربع التنبيه شرطيًا في المستدعي عندما ينبغي أن يؤدي الإغلاق إلى إخفائه. يبقى المحتوى المترجم الحالي وتسميات الإجراءات في التطبيق.
الخصائص
ReactNode
Optional footer node. Use Callout.Action for the standard action or supply custom controls.
string
Additional class names merged onto the root.
string
افتراضي:"Close"
Accessible name of the dismiss button. Defaults to
Close."blue" | "gray" | "green" | "orange" | "red"
افتراضي:"status palette"
Palette override: gray, blue, green, orange, or red. Defaults to the status palette.
ReactNode
Optional supporting content node. Empty slots are hidden.
boolean
افتراضي:"false"
Removes the default 512px maximum width.
ReactNode
افتراضي:"decorative help icon"
Leading icon node. Defaults to a decorative help icon. Pass null to omit it.
(() => void)
Shows a dismiss button and notifies the caller once per activation. The caller owns visibility.
Ref<HTMLDivElement>
Ref to the root div, or the element supplied through render.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, CalloutState>
Element or callback composition for the root. Receives status, variant, and color state.
"error" | "info" | "neutral" | "success" | "warning"
افتراضي:"info"
Feedback meaning: neutral, info, success, warning, or error. Defaults to info.
CSSProperties
Inline styles forwarded to the root.
ReactNode
مطلوب
Main message node displayed beside the icon.
"soft"
افتراضي:"soft"
Supported appearance: soft.
Callout.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.
"accent" | "danger" | "inherit" | "neutral" | "success"
Semantic color of the button.
inherit uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.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.