컨테이너
컨테이너 (Container)
Container는 콘텐츠의 너비를 중앙 정렬하고 제한하는 레이아웃 요소예요. 기본 slot 하나만으로 손쉽게 콘텐츠를 가운데로 모으고 넓이를 조절할 수 있어요.
출처: Nuxt UI
본문
사용법 (Usage)
기본 slot을 사용하면 콘텐츠를 중앙 정렬하고 너비를 제한할 수 있어요.
[!TIP] See: /docs/getting-started/theme/css-variables#container
최대 너비는
--ui-containerCSS 변수로 제어돼요.
<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'
}
}
})