PageCTA
페이지에 표시할 작업 호출 섹션입니다.
Usage
PageCTA 구성 요소는 기본 슬롯에 그림과 함께 페이지에 작업 활용 방안을 표시할 수있는 유연한 방법을 제공합니다.
Trusted and supported by our amazing community
Preview the latest Tailwind CSS and get started with Nuxt UI.
PageSection 구성 요소 내에서 사용하거나 페이지에서 직접 사용합니다.
<template>
<UPageHero />
<UPageCTA class="rounded-none" />
<UPageSection />
<UPageSection :ui="{ container: 'px-0' }">
<UPageCTA class="rounded-none sm:rounded-xl" />
</UPageSection>
<UPageSection />
</template>
px-0 및 rounded-none 클래스를 사용하여 CTA가 모바일에서 페이지 가장자리를 채우도록합니다.Title 파일
title prop을 사용하여 CTA 제목을 설정합니다.
Trusted and supported by our amazing community
<template>
<UPageCTA title="Trusted and supported by our amazing community" />
</template>설명
description prop을 사용하여 CTA 설명을 설정합니다.
Trusted and supported by our amazing community
We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success.
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
/>
</template>링크
links prop를 사용하여 설명 아래에 Button 목록을 표시합니다.
Trusted and supported by our amazing community
We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success.
<script setup lang="ts">
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
:links="links"
/>
</template><script setup lang="ts">
import { ref } from 'vue'
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
:links="links"
/>
</template>변형
variant prop을 사용하여 CTA 스타일을 변경합니다.
Trusted and supported by our amazing community
We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success.
<script setup lang="ts">
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
variant="soft"
:links="links"
/>
</template><script setup lang="ts">
import { ref } from 'vue'
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
variant="soft"
:links="links"
/>
</template>solid 변형을 사용하여 색상을 반대로 바꿀 때 light 또는 dark 클래스를 links 슬롯에 적용할 수 있습니다.방향
orientation 소품을 사용하여 기본 슬롯을 사용하여 방향을 변경합니다. 기본값은 vertical입니다.
Trusted and supported by our amazing community
We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success.
<script setup lang="ts">
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
orientation="horizontal"
:links="links"
>
<img
src="https://picsum.photos/640/728"
width="320"
height="364"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageCTA>
</template><script setup lang="ts">
import { ref } from 'vue'
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
orientation="horizontal"
:links="links"
>
<img
src="https://picsum.photos/640/728"
width="320"
height="364"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageCTA>
</template>반전
reverse 소품을 사용하여 기본 슬롯의 방향을 반대로 합니다.
Trusted and supported by our amazing community
We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success.
<script setup lang="ts">
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
orientation="horizontal"
reverse
:links="links"
>
<img
src="https://picsum.photos/640/728"
width="320"
height="364"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageCTA>
</template><script setup lang="ts">
import { ref } from 'vue'
import type { ButtonProps } from '@nuxt/ui'
const links = ref<ButtonProps[]>([
{
label: 'Get started',
color: 'neutral'
},
{
label: 'Learn more',
color: 'neutral',
variant: 'subtle',
trailingIcon: 'i-lucide-arrow-right'
}
])
</script>
<template>
<UPageCTA
title="Trusted and supported by our amazing community"
description="We've built a strong, lasting partnership. Their trust is our driving force, propelling us towards shared success."
orientation="horizontal"
reverse
:links="links"
>
<img
src="https://picsum.photos/640/728"
width="320"
height="364"
alt="Illustration"
class="w-full rounded-lg"
loading="lazy"
/>
</UPageCTA>
</template>API
Props (### Props)
| Prop | Default | Type |
|---|---|---|
as | 'div' | anyThe element or component this component should render as. |
title | string | |
description | string | |
orientation | 'vertical' | "vertical" | "horizontal"The orientation of the page cta. |
reverse | false | boolean Reverse the order of the default slot. |
variant | 'outline' | "outline" | "solid" | "soft" | "subtle" | "naked" |
links | ButtonProps[]Display a list of Button under the description.
| |
ui | { root?: SlotClass; container?: SlotClass; wrapper?: SlotClass; header?: SlotClass; title?: SlotClass; description?: SlotClass; body?: SlotClass; footer?: SlotClass; links?: SlotClass; } |
Slots
| Slot | Type |
|---|---|
top | {} |
header | {} |
title | {} |
description | {} |
body | {} |
footer | {} |
links | {} |
default | {} |
bottom | {} |
Theme 테마
app.config.ts
export default defineAppConfig({
ui: {
pageCTA: {
slots: {
root: 'relative isolate rounded-xl overflow-hidden',
container: 'flex flex-col lg:grid px-6 py-12 sm:px-12 sm:py-24 lg:px-16 lg:py-24 gap-8 sm:gap-16',
wrapper: '',
header: '',
title: 'text-3xl sm:text-4xl text-pretty tracking-tight font-bold text-highlighted',
description: 'text-base sm:text-lg text-muted',
body: 'mt-8',
footer: 'mt-8',
links: 'flex flex-wrap gap-x-6 gap-y-3'
},
variants: {
orientation: {
horizontal: {
container: 'lg:grid-cols-2 lg:items-center',
description: 'text-pretty'
},
vertical: {
container: '',
title: 'text-center',
description: 'text-center text-balance',
links: 'justify-center'
}
},
reverse: {
true: {
wrapper: 'order-last'
}
},
variant: {
solid: {
root: 'bg-inverted text-inverted',
title: 'text-inverted',
description: 'text-dimmed'
},
outline: {
root: 'bg-default ring ring-default',
description: 'text-muted'
},
soft: {
root: 'bg-elevated/50',
description: 'text-toned'
},
subtle: {
root: 'bg-elevated/50 ring ring-default',
description: 'text-toned'
},
naked: {
description: 'text-muted'
}
},
title: {
true: {
description: 'mt-6'
}
}
},
defaultVariants: {
variant: 'outline'
}
}
}
})vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
ui: {
pageCTA: {
slots: {
root: 'relative isolate rounded-xl overflow-hidden',
container: 'flex flex-col lg:grid px-6 py-12 sm:px-12 sm:py-24 lg:px-16 lg:py-24 gap-8 sm:gap-16',
wrapper: '',
header: '',
title: 'text-3xl sm:text-4xl text-pretty tracking-tight font-bold text-highlighted',
description: 'text-base sm:text-lg text-muted',
body: 'mt-8',
footer: 'mt-8',
links: 'flex flex-wrap gap-x-6 gap-y-3'
},
variants: {
orientation: {
horizontal: {
container: 'lg:grid-cols-2 lg:items-center',
description: 'text-pretty'
},
vertical: {
container: '',
title: 'text-center',
description: 'text-center text-balance',
links: 'justify-center'
}
},
reverse: {
true: {
wrapper: 'order-last'
}
},
variant: {
solid: {
root: 'bg-inverted text-inverted',
title: 'text-inverted',
description: 'text-dimmed'
},
outline: {
root: 'bg-default ring ring-default',
description: 'text-muted'
},
soft: {
root: 'bg-elevated/50',
description: 'text-toned'
},
subtle: {
root: 'bg-elevated/50 ring ring-default',
description: 'text-toned'
},
naked: {
description: 'text-muted'
}
},
title: {
true: {
description: 'mt-6'
}
}
},
defaultVariants: {
variant: 'outline'
}
}
}
})
]
})변경 로그
No recent changes