Lynx

Callout

A message component that visually emphasizes and conveys important information or tips to users.

Engine ≥ 3.6
Available since@seed-design/lynx-react@0.5.0, @seed-design/lynx-css@0.9.0
Loading Lynx example…

Installation

npx @seed-design/cli@latest add ui:callout

Properties

Callout

Prop

Type

prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
title?React.ReactNode
descriptionReact.ReactNode
linkProps?SeedCallout.LinkProps | undefined
bindtap?EventHandler<BaseTouchEvent<Target>> | undefined
main-thread:bindtap?EventHandler<BaseTouchEvent<Element>> | undefined
style?CSSProperties | undefined
className?string | undefined

ActionableCallout

Prop

Type

prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
title?React.ReactNode
descriptionReact.ReactNode
className?string | undefined
bindtap?EventHandler<BaseTouchEvent<Target>> | undefined
main-thread:bindtap?EventHandler<BaseTouchEvent<Element>> | undefined
style?CSSProperties | undefined

DismissibleCallout

Prop

Type

prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
title?React.ReactNode
descriptionReact.ReactNode
linkProps?SeedCallout.LinkProps | undefined
dismissLabel?string | undefined
className?string | undefined
bindtap?EventHandler<BaseTouchEvent<Target>> | undefined
main-thread:bindtap?EventHandler<BaseTouchEvent<Element>> | undefined
open?boolean | undefined
defaultOpen?boolean | undefined
onDismiss?(() => void) | undefined
style?CSSProperties | undefined

Usage

The installed snippet exports the basic Callout, ActionableCallout which makes the entire area tappable, and DismissibleCallout which can be dismissed.

import { Callout } from "@/components/ui/callout";

export function App() {
  return <Callout title="Notification" description="Check out the latest news." />;
}

If you need low-level composition, you can use the compound API of @seed-design/lynx-react directly.

import { Callout } from "@seed-design/lynx-react";

export function App() {
  return (
    <Callout.Root tone="informative">
      <Callout.Content>
        <Callout.Title>Notification</Callout.Title>
        <Callout.Description>Check out the latest news.</Callout.Description>
      </Callout.Content>
    </Callout.Root>
  );
}

Examples

Content Composition

Text Only

Loading Lynx example…

With Icon

Loading Lynx example…

With Title Text

Loading Lynx example…

ActionableCallout does not provide linkProps.

Loading Lynx example…

With All Elements

Loading Lynx example…

Tone

tone supports neutral, informative, positive, warning, critical, and magic. The default is neutral.

Neutral (Default)

Loading Lynx example…

Informative

Loading Lynx example…

Positive

Loading Lynx example…

Warning

Loading Lynx example…

Critical

Loading Lynx example…

Magic

Loading Lynx example…

Differences from Web Version

AreaReactLynx
Elementdiv, span, buttonview, text
EventonClickbindtap, main-thread:bindtap
AccessibilityHTML semantic elements, ARIAaccessibility-*
PolymorphismasChild supportedNot supported
Link underlinetext-decorationBorder-based representation due to Lynx preset constraints

In Lynx, the pressed Recipe variant is applied while pressing a tappable Root. Callout.Link uses accessibility-traits="link" by default. The button role is applied to tappable Root and CloseButton.

Lynx Unsupported Features

  • asChild: Lynx does not have DOM Slot-based polymorphic rendering.
  • Rendering link labels as child elements: Instead of asChild, pass the link text to linkProps.children and handle tap actions with linkProps.bindtap.

Table of contents