# Nuxt Built-in Components ## When to Use Working with images, links, or time display in templates. **Always prefer Nuxt components over HTML elements.** ## Component Preferences | HTML Element | Nuxt Component | Why | | ------------ | -------------- | -------------------------------------- | | `` | `` | Client-side navigation, prefetching | | `` | `` | Optimization, lazy loading, responsive | | `` for internal links:** ```vue ``` **Props:** - `to` - Route path or route object - `external` - Force external link behavior - `target` - Link target (`_blank`, etc.) - `prefetch` - Enable/disable prefetching (default: true) - `noPrefetch` - Disable prefetching - `activeClass` - Class when route matches - `exactActiveClass` - Class when route exactly matches **Docs:** https://nuxt.com/docs/api/components/nuxt-link ## NuxtImg **ALWAYS use `` instead of `` for images:** Requires `@nuxt/image` module (usually pre-installed). ```vue ``` **Props:** - `src` - Image source path - `alt` - Alt text (required for accessibility) - `width` / `height` - Dimensions - `sizes` - Responsive sizes - `loading` - `lazy` (default) or `eager` - `placeholder` - Show blur placeholder while loading - `format` - Force output format (`webp`, `avif`, etc.) - `quality` - Image quality (1-100) - `provider` - Image provider (cloudinary, imgix, etc.) **For art direction, use `` (different sources per breakpoint).** **Docs:** https://image.nuxt.com/usage/nuxt-img ## NuxtTime **ALWAYS use `` instead of `` | `` | | `` | `` | | `` | `` | | `formatTimeAgo(date)` in template | `` | | `new Date().toLocaleDateString()` | `` | ## Best Practices - **NuxtLink for all internal routes** - enables prefetching and client-side navigation - **NuxtImg for all images** - automatic optimization, lazy loading, responsive - **NuxtTime for all dates** - SSR-safe, automatic localization - **Always provide alt text** for images - **Use `loading="eager"`** for above-the-fold images - **Use sizes prop** for responsive images ## Resources - NuxtLink: https://nuxt.com/docs/api/components/nuxt-link - NuxtImg: https://image.nuxt.com/usage/nuxt-img - NuxtPicture: https://image.nuxt.com/usage/nuxt-picture - NuxtTime: https://nuxt.com/docs/api/components/nuxt-time