본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

App

원문 보기 위키 갱신

App (앱 래퍼)

App 컴포넌트는 앱 전체에 전역 설정과 토스트, 툴팁을 제공하는 래퍼(wrapper) 컴포넌트예요. 앱을 <UApp>으로 감싸면 모든 컴포넌트가 공통 설정을 상속받아 일관된 동작을 보장해요.

출처: Nuxt UI

본문

사용법 (Usage)

이 컴포넌트는 Reka UI의 ConfigProvider를 구현해서 모든 컴포넌트에 전역 설정을 제공해요:

  • 모든 프리미티브가 전역 읽기 방향을 상속받을 수 있어요.
  • body lock 설정 시 스크롤 바디 동작을 변경할 수 있어요.
  • 레이아웃 이동을 방지하는 다양한 제어 기능을 제공해요.

또한 ToastProvider와 TooltipProvider를 사용해 전역 토스트와 툴팁은 물론, 프로그래밍 방식의 모달과 슬라이드오버도 제공해요.

app.vue 파일에서 전체 애플리케이션을 App 컴포넌트로 감싸세요:

<template>
  <UApp>
    <NuxtPage />
  </UApp>
</template>

Nuxt:

[!TIP] See: /docs/getting-started/integrations/i18n/nuxt#locale

locale prop을 사용해 앱의 로케일을 변경하는 방법을 알아보세요. 이 설정은 Calendar, InputDate, InputTime 같은 컴포넌트의 날짜/시간 형식도 함께 제어해요.

Vue:

[!TIP] See: /docs/getting-started/integrations/i18n/vue#locale

locale prop을 사용해 앱의 로케일을 변경하는 방법을 알아보세요. 이 설정은 Calendar, InputDate, InputTime 같은 컴포넌트의 날짜/시간 형식도 함께 제어해요.

API

Props (속성)

/**
 * Props for the App component
 */
interface AppProps {
  tooltip?: TooltipProviderProps | undefined;
  toaster?: null | ToasterProps | undefined;
  locale?: Locale<T> | undefined;
  /**
   * @default 'body'
   */
  portal?: string | false | true | HTMLElement | undefined;
  /**
   * The global reading direction of your application. This will be inherited by all primitives.
   * @default 'ltr'
   */
  dir?: "ltr" | "rtl" | undefined;
  /**
   * The global scroll body behavior of your application. This will be inherited by the related primitives.
   */
  scrollBody?: boolean | ScrollBodyOption | undefined;
  /**
   * The global `nonce` value of your application. This will be inherited by the related primitives.
   */
  nonce?: string | undefined;
}

Slots (슬롯)

/**
 * Slots for the App component
 */
interface AppSlots {
  default(): any;
}

변경 이력 (Changelog)

컴포넌트와 테마의 커밋 기록을 확인하세요.

더 알아보기 (Learn more)