Lynx

Page Banner

페이지 상단에서 전체 상태나 중요한 메시지를 전달하는 상위 레벨 메시지 컴포넌트입니다.

Engine ≥ 3.6
사용 가능 버전@seed-design/[email protected], @seed-design/[email protected]
Lynx 예제를 불러오는 중입니다.

Installation

npx @seed-design/cli@latest add ui:page-banner

Props

PageBanner

Prop

Type

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

PageBannerButton

고유 prop이 없습니다. className, style, children, bindtap, main-thread:bindtap을 받습니다.

ActionablePageBanner

Prop

Type

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

DismissiblePageBanner

Prop

Type

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

Usage

import { PageBanner } from "@/components/ui/page-banner";

export function App() {
  return <PageBanner title="알림" description="새로운 소식을 확인해 보세요." />;
}

Examples

With Button

PageBanner의 suffix에 PageBannerButton을 전달하면 메시지 옆에 버튼을 배치할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Tones and Variants

tone은 neutral, positive, informative, warning, critical, magic을 지원합니다. variant는 weak과 solid를 지원합니다. 기본 조합은 neutral과 weak입니다.

Neutral

Lynx 예제를 불러오는 중입니다.

Positive

Lynx 예제를 불러오는 중입니다.

Informative

Lynx 예제를 불러오는 중입니다.

Warning

Lynx 예제를 불러오는 중입니다.

Critical

Lynx 예제를 불러오는 중입니다.

Magic

tone="magic"은 variant="weak"과만 함께 사용할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Action and Dismiss

전체 배너를 액션으로 사용하려면 ActionablePageBanner에 bindtap과 accessibility-label을 전달하세요. 닫기 상태를 직접 관리하려면 DismissiblePageBanner의 open과 onDismiss를 사용합니다.

Web Version Differences

  • 탭 이벤트는 onClick 대신 bindtap 또는 main-thread:bindtap으로 받습니다.
  • 접근성은 HTML 의미 요소와 ARIA 대신 Lynx의 accessibility-* 속성을 사용합니다.
  • CloseButton은 Root의 직접 자식이나 Fragment 안에 두세요. 다른 컴포넌트로 감싸면 배너 본문과 함께 눌림 피드백이 적용됩니다.

Unsupported Lynx Features

  • asChild를 지원하지 않습니다.
  • 웹의 focus ring과 HTML 속성은 지원하지 않습니다. 대응하는 Lynx native 속성을 사용하세요.

Last updated on

목차