Skip to Content
Lynx

Page Banner

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

Engine ≥ 3.6
사용 가능 버전@seed-design/lynx-react@0.6.0, @seed-design/lynx-css@0.10.0
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 속성을 사용하세요.

Extending to Safe Area

extendSafeAreaX를 지정하면 배경이 좌우 Safe Area까지 확장되고, 아이콘·글자·버튼은 기존 위치에 남습니다. 배너 내용의 눌림 피드백과 tone별 배경은 유지됩니다. 기본값은 false입니다.

Box pl="safeArea" pr="safeArea"처럼 좌우 inset을 이미 확보한 컨테이너 바로 안에서 사용하세요. inset을 확보하지 않은 곳에 적용하면 화면 밖으로 넘칠 수 있습니다.

배너와 이 컨테이너 사이에 다른 레이아웃을 두면 해당 레이아웃에 style={{ overflow: "visible" }}을 지정해야 확장한 배경이 잘리지 않습니다.

확장 전 / 확장 후

비교확장 전 (AS IS)확장 후 (TO BE)
배경·스크롤 영역배너 배경이 안전 영역 안에서 끝남배너 배경이 좌우 끝까지 이어짐
콘텐츠안전 영역 안에 배치텍스트·아이콘·액션의 위치는 유지

아래 스위치를 켜고 끄며 같은 예제에서 비교할 수 있습니다. 브라우저에는 비교용 좌우 inset을 적용합니다. 붉은 빗금은 콘텐츠를 피해야 하는 inset 영역이며, 두 경계선 사이는 안전 영역입니다. QR로 연 기기에서는 실제 inset을 사용하므로, 좌우 inset이 모두 0이면 차이가 보이지 않을 수 있습니다. 적용 조건은 Safe Area 가이드를 참고하세요.

비교용 inset: 왼쪽 24px · 오른쪽 48px (가상)

붉은 빗금은 콘텐츠를 피해야 하는 inset 영역이며, 두 경계선 사이는 안전 영역입니다.

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

Last updated on

목차