React

AppBar

화면 상단에서 현재 화면의 제목과 탐색 액션을 보여주는 내비게이션 바 컴포넌트입니다.

사용 가능 버전@seed-design/[email protected], @seed-design/[email protected]

Installation

npx @seed-design/cli@latest add ui:app-screen

React Registry는 AppBar를 AppScreen과 함께 설치합니다. AppBar는 Stackflow Activity 안에서 AppScreen과 함께 사용하세요. Stackflow 설정은 Getting Started를 참고하세요.

Props

AppBar

Prop

Type

background?(string & {}) | ScopedColorBg | ScopedColorPalette | ScopedColorBanner | undefined

AppBarLeft

Prop

Type

AppBarMain

Prop

Type

AppBarRight

Prop

Type

AppBarSlot

Prop

Type

AppBarIconButton

Prop

Type

Usage

설치한 snippet은 Root와 주요 슬롯을 AppBar, AppBarLeft, AppBarMain, AppBarRight로 내보냅니다. AppBarBackButton은 현재 Activity가 루트가 아닐 때 나타나며, 클릭하면 이전 Activity로 이동합니다.

import {
  AppBar,
  AppBarBackButton,
  AppBarLeft,
  AppBarMain,
  AppBarRight,
} from "@/components/ui/app-bar";

export function Header() {
  return (
    <AppBar>
      <AppBarLeft>
        <AppBarBackButton />
      </AppBarLeft>
      <AppBarMain title="동네생활" />
      <AppBarRight />
    </AppBar>
  );
}

Title / Subtitle

AppBarMaintitle, subtitle을 전달하면 제목과 부제목을 조립합니다. subtitle이 있으면 layout="withSubtitle"을 자동으로 적용합니다.

Left / Right Action

왼쪽과 오른쪽에는 아이콘 버튼이나 커스텀 슬롯을 배치할 수 있습니다. Cupertino theme에서는 좌우 슬롯 폭을 기준으로 가운데 제목의 padding을 조정합니다.

Accessibility

아이콘만 있는 버튼에는 동작을 설명하는 aria-label을 지정하세요. AppBarBackButtonAppBarCloseButton은 각각 "뒤로", "닫기"를 기본값으로 제공합니다.

Theme

theme"cupertino" 또는 "android"를 사용할 수 있습니다. AppScreen과 같은 theme을 사용하세요.

Last updated on

목차