PageFeature

GitLab
Um componente para destacar os principais recursos da sua aplicação.

Uso

O componente PageFeature é usado pelo componente PageSection para exibir recursos.

Título

Use a prop title para definir o título do recurso.

Theme
<template>
  <NPageFeature title="Theme" />
</template>

Descrição

Use a prop description para definir a descrição do recurso.

Theme
Customize Nitro UI with your own colors, fonts, and more.
<template>
  <NPageFeature
    title="Theme"
    description="Customize Nitro UI with your own colors, fonts, and more."
  />
</template>

Ícone

Use a prop icon para definir o ícone do recurso.

Theme
Customize Nitro UI with your own colors, fonts, and more.
<template>
  <NPageFeature
    title="Theme"
    description="Customize Nitro UI with your own colors, fonts, and more."
    icon="i-lucide-swatch-book"
  />
</template>

Você pode passar qualquer propriedade do componente <NuxtLink>, como to, target, rel, etc.

Theme
Customize Nitro UI with your own colors, fonts, and more.
<template>
  <NPageFeature
    title="Theme"
    description="Customize Nitro UI with your own colors, fonts, and more."
    icon="i-lucide-swatch-book"
    to="/docs/getting-started/theme/design-system"
    target="_blank"
  />
</template>

Orientação

Use a prop orientation para alterar a orientação do recurso. O padrão é horizontal.

Theme
Customize Nitro UI with your own colors, fonts, and more.
<template>
  <NPageFeature
    orientation="vertical"
    title="Theme"
    description="Customize Nitro UI with your own colors, fonts, and more."
    icon="i-lucide-swatch-book"
  />
</template>

API

Props

Prop Default Type
as'div'any

The element or component this component should render as.

iconany

The icon displayed next to the title when orientation is horizontal and above the title when orientation is vertical.

title string
description string
orientation'horizontal' "horizontal" | "vertical"

The orientation of the page feature.

to string | it | et
target null | "_blank" | "_parent" | "_self" | "_top" | string & {}
ui { root?: SlotClass; wrapper?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; title?: SlotClass; description?: SlotClass; }

Slots

Slot Type
leading{ ui: object; }
title{}
description{}
default{}

Tema

app.config.ts
export default defineAppConfig({
  ui: {
    pageFeature: {
      slots: {
        root: 'relative rounded-sm',
        wrapper: '',
        leading: 'inline-flex items-center justify-center',
        leadingIcon: 'size-5 shrink-0 text-primary',
        title: 'text-base text-pretty font-semibold text-highlighted',
        description: 'text-[15px] text-pretty text-muted'
      },
      variants: {
        orientation: {
          horizontal: {
            root: 'flex items-start gap-2.5',
            leading: 'p-0.5'
          },
          vertical: {
            leading: 'mb-2.5'
          }
        },
        to: {
          true: {
            root: [
              'outline-primary/25 has-focus-visible:outline-3',
              'transition'
            ]
          }
        },
        title: {
          true: {
            description: 'mt-1'
          }
        }
      }
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nitro/ui/vite'

export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        pageFeature: {
          slots: {
            root: 'relative rounded-sm',
            wrapper: '',
            leading: 'inline-flex items-center justify-center',
            leadingIcon: 'size-5 shrink-0 text-primary',
            title: 'text-base text-pretty font-semibold text-highlighted',
            description: 'text-[15px] text-pretty text-muted'
          },
          variants: {
            orientation: {
              horizontal: {
                root: 'flex items-start gap-2.5',
                leading: 'p-0.5'
              },
              vertical: {
                leading: 'mb-2.5'
              }
            },
            to: {
              true: {
                root: [
                  'outline-primary/25 has-focus-visible:outline-3',
                  'transition'
                ]
              }
            },
            title: {
              true: {
                description: 'mt-1'
              }
            }
          }
        }
      }
    })
  ]
})

Changelog

No recent changes