Resumen
Callout combina nodos de título, descripción, icono y acción. Usa status para neutral, info, success, warning o error. El valor predeterminado es info y admite la apariencia soft. El estado selecciona una paleta gris, azul, verde, naranja o roja; color anula esa paleta sin cambiar el significado.
”Uso”
Opciones visuales
Compare los estados semánticos usando el mismo contenido. Elija un estado para el significado del mensaje y anule el color solo cuando el diseño circundante lo requiera.Aviso descartable
Descarte y etiquetas
PasaronDismiss expone un botón de cierre accesible. Cada activación con puntero o teclado lo llama una vez. El callout permanece renderizado hasta que quien lo invoca lo oculta. Omite onDismiss para un mensaje persistente. closeLabel usa Close de forma predeterminada.
Tu aplicación es propietaria del contenido, las acciones, los nombres accesibles y las traducciones. Usa Callout.Action para un botón fantasma pequeño con un grosor de fuente normal. Acepta las props de Button, incluidos los atributos de enlace, el estado deshabilitado, las refs y el renderizado personalizado; el tamaño y la apariencia son fijos. El espacio para acciones también acepta botones personalizados, enlaces, controles deshabilitados o varios nodos. El icono de ayuda predeterminado es decorativo; pasa icon={null} para omitirlo o proporciona un nodo con la semántica accesible adecuada. Twenty no requiere un proveedor de i18n.
Integración nativa
Los atributos nativos,className, style y ref se aplican al div raíz. Usa render para componer un elemento raíz diferente o una devolución de llamada que reciba las props raíz y { status, variant, color }. title y description son espacios de contenido. fullWidth elimina el ancho máximo predeterminado de 512px.
El componente no agrega ningún rol de región activa ni anuncios. Proporciona role, aria-live y otros atributos accesibles nativos cuando el flujo de trabajo circundante los requiera.
Migración
Reemplaza elvariant semántico anterior por status, y el constructor Icon por un nodo icon. Reemplaza los objetos de acción { label, onClick } por Callout.Action o controles personalizados. Reemplaza isClosable y onClose por onDismiss, y renderiza condicionalmente el callout en quien lo invoca cuando descartarlo deba ocultarlo. El contenido traducido y las etiquetas de acción existentes permanecen en la aplicación.
”Props”
ReactNode
Optional footer node. Use Callout.Action for the standard action or supply custom controls.
string
Additional class names merged onto the root.
string
predeterminado:"Close"
Accessible name of the dismiss button. Defaults to
Close."blue" | "gray" | "green" | "orange" | "red"
predeterminado:"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
predeterminado:"false"
Removes the default 512px maximum width.
ReactNode
predeterminado:"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"
predeterminado:"info"
Feedback meaning: neutral, info, success, warning, or error. Defaults to info.
CSSProperties
Inline styles forwarded to the root.
ReactNode
requerido
Main message node displayed beside the icon.
"soft"
predeterminado:"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
predeterminado:"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
predeterminado:"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.