Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Guidance for building UIs with Nuxt UI, the official Tailwind-based component library for Nuxt.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/layouts/landing.md
1# Landing Page Layout23Build public-facing pages — landing, blog, changelog, pricing — using the Header + Main + Footer shell with Page components.45## When to use67- Marketing sites, product pages, company sites8- Blog and content pages9- Pricing, changelog, portfolio pages10- Any public-facing page that isn't a dashboard or documentation1112## App shell1314```vue [app.vue]15<script setup lang="ts">16import type { NavigationMenuItem } from '@nuxt/ui'1718const items = computed<NavigationMenuItem[]>(() => [{19label: 'Features',20to: '#features'21}, {22label: 'Pricing',23to: '/pricing'24}, {25label: 'Blog',26to: '/blog'27}])28</script>2930<template>31<UApp>32<UHeader>33<template #title>34<Logo class="h-6 w-auto" />35</template>3637<UNavigationMenu :items="items" />3839<template #right>40<UColorModeButton />41<UButton label="Sign in" color="neutral" variant="ghost" />42<UButton label="Get started" />43</template>4445<template #body>46<UNavigationMenu :items="items" orientation="vertical" class="-mx-2.5" />47</template>48</UHeader>4950<UMain>51<NuxtPage />52</UMain>5354<UFooter>55<template #left>56<p class="text-muted text-sm">Copyright © {{ new Date().getFullYear() }}</p>57</template>58<template #right>59<UButton icon="i-simple-icons-github" color="neutral" variant="ghost" to="https://github.com" target="_blank" />60</template>61</UFooter>62</UApp>63</template>64```6566### Common mistakes6768- Forgetting the `#body` slot on `UHeader` — this is the mobile menu content. Without it, mobile users have no navigation.69- Using `variant="solid"` for both header and hero buttons — the header button should be lower weight than the hero CTA.7071## Landing page7273```vue [pages/index.vue]74<template>75<UPageHero76title="Build faster with Nuxt UI"77description="A comprehensive Vue UI component library."78:links="[79{ label: 'Get started', to: '/docs', icon: 'i-lucide-square-play' },80{ label: 'Learn more', color: 'neutral', variant: 'subtle', trailingIcon: 'i-lucide-arrow-right' }81]"82orientation="horizontal"83>84<img src="/hero-image.png" alt="App screenshot" class="rounded-lg shadow-2xl ring ring-default" />85</UPageHero>8687<UPageSection88id="features"89headline="Features"90title="Everything you need"91description="A comprehensive suite of components and utilities."92:features="[93{ title: 'Accessible', description: 'Built on Reka UI with full ARIA support.', icon: 'i-lucide-accessibility' },94{ title: 'Customizable', description: 'Tailwind Variants theming with full control.', icon: 'i-lucide-palette' },95{ title: 'Responsive', description: 'Mobile-first components.', icon: 'i-lucide-monitor-smartphone' }96]"97/>9899<UPageCTA100title="Trusted by thousands of developers"101description="Join the community and start building today."102:links="[103{ label: 'Get started', color: 'neutral' },104{ label: 'Star on GitHub', color: 'neutral', variant: 'subtle', trailingIcon: 'i-lucide-arrow-right' }105]"106/>107108<UPageSection id="pricing" headline="Pricing" title="Simple, transparent pricing">109<UPricingPlans110:plans="[111{ title: 'Free', price: '$0', description: 'For personal projects', features: ['10 components', 'Community support'] },112{ title: 'Pro', price: '$99', description: 'For teams', features: ['All components', 'Priority support'], highlight: true },113{ title: 'Enterprise', price: 'Custom', description: 'For large teams', features: ['Custom components', 'Dedicated support'] }114]"115/>116</UPageSection>117</template>118```119120## Key components121122- `UPageHero` — hero with title, description, links, and optional media. Use `orientation="horizontal"` for side-by-side layout.123- `UPageSection` — content section with headline, title, description, and `features` grid. Use `id` for anchor links.124- `UPageCTA` — call to action block.125- `UPageGrid` / `UPageCard` — card grid for features, testimonials, etc.126- `UPageFeature` — individual feature item.127- `UPageLogos` — logo wall for social proof.128- `UPricingPlans` / `UPricingTable` — pricing cards and comparison tables.129- `UFooterColumns` — multi-column footer with link groups (used inside `UFooter`).130131## Variations132133### Alternating feature sections134135```vue136<UPageSection title="Feature A" orientation="horizontal">137<img src="/feature-a.png" />138</UPageSection>139140<UPageSection title="Feature B" orientation="horizontal" reverse>141<img src="/feature-b.png" />142</UPageSection>143```144145### Blog listing146147```vue [pages/blog/index.vue]148<script setup lang="ts">149const { data: posts } = await useAsyncData('posts', () => queryCollection('posts').all())150</script>151152<template>153<UPage>154<UPageHero title="Blog" description="The latest news and updates." />155<UPageBody>156<UContainer>157<UBlogPosts>158<UBlogPost v-for="post in posts" :key="post.path" v-bind="post" :to="post.path" />159</UBlogPosts>160</UContainer>161</UPageBody>162</UPage>163</template>164```165166### Changelog167168```vue [pages/changelog.vue]169<script setup lang="ts">170const { data: versions } = await useAsyncData('versions', () => queryCollection('changelog').all())171</script>172173<template>174<UPage>175<UPageHero title="Changelog" />176<UPageBody>177<UContainer>178<UChangelogVersions>179<UChangelogVersion v-for="version in versions" :key="version.path" v-bind="version" />180</UChangelogVersions>181</UContainer>182</UPageBody>183</UPage>184</template>185```186