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

컨테이너

원문 보기 위키 갱신

컨테이너 (Container)

Container는 콘텐츠의 너비를 중앙 정렬하고 제한하는 레이아웃 요소예요. 기본 slot 하나만으로 손쉽게 콘텐츠를 가운데로 모으고 넓이를 조절할 수 있어요.

출처: Nuxt UI

본문

사용법 (Usage)

기본 slot을 사용하면 콘텐츠를 중앙 정렬하고 너비를 제한할 수 있어요.

[!TIP] See: /docs/getting-started/theme/css-variables#container

최대 너비는 --ui-container CSS 변수로 제어돼요.

<template>
  <UContainer>
    <Placeholder class="h-32" />
  </UContainer>
</template>

API

Props

/**
 * Props for the Container component
 */
interface ContainerProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  ui?: { base?: any; } | undefined;
}

Slots

/**
 * Slots for the Container component
 */
interface ContainerSlots {
  default(): any;
}

테마 (Theme)

export default defineAppConfig({
  ui: {
    container: {
      base: 'w-full max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8'
    }
  }
})

더 알아보기 (Learn more)