본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

AI 프롬프트

원문 보기 위키 갱신

AI 프롬프트 (ProsePrompt)

미리 작성된 AI 프롬프트를 한 번의 클릭으로 복사하거나 IDE에서 바로 열 수 있게 보여주는 컴포넌트예요. 프롬프트 공유나 문서화에 유용하게 쓰입니다.

출처: Nuxt UI

본문

prompt 컴포넌트를 사용하면 미리 작성된 AI 프롬프트를 표시하고, 사용자가 이를 클립보드에 복사하거나 IDE에서 바로 열 수 있어요. description prop은 눈에 보이는 라벨로 표시되고, 기본 슬롯에는 복사되는 프롬프트 텍스트가 들어갑니다.

::prompt{description="Build a dashboard layout with Nuxt UI."}
You are a Nuxt UI expert. Help me build a dashboard layout with a collapsible sidebar and a sticky top navbar.

Requirements:
- Use `UDashboardPanel`, `UDashboardSidebar`, and `UDashboardNavbar`
- Use semantic color tokens like `bg-elevated` and `text-muted` for theming
- The sidebar should include navigation links with icons using `UNavigationMenu`
- The navbar should display a breadcrumb, a search button, and a user dropdown menu
- The layout must be fully responsive and collapse the sidebar on mobile
::

아이콘 (Icon)

icon prop을 사용하면 description 옆에 아이콘을 표시할 수 있어요.

::prompt{description="Create a form with validation." icon="i-lucide-file-pen-line"}
Create a registration form using Nuxt UI with Zod schema validation.

Requirements:
- Use `UForm` with a Zod schema for validation
- Add `UFormField` wrapping each input: name (`UInput`), email (`UInput` type email), role (`USelect` with options Admin, Editor, Viewer)
- Include a submit `UButton` with loading state
- Display inline error messages below each field
- On successful submit, show a `UToast` notification
::

동작 (Actions)

actions prop을 사용하면 추가 버튼을 표시할 수 있어요. copy 버튼은 항상 표시되며, 사용 가능한 동작은 cursor, windsurf, claude입니다.

::prompt{description="Add a color mode toggle." icon="i-lucide-sun-moon" actions="cursor,claude"}
Add a color mode toggle to my Nuxt app.

Requirements:
- Use `useColorMode` from `@nuxtjs/color-mode` to manage the current mode
- Render a `UButton` with `variant="ghost"` that cycles between `light`, `dark`, and `system` on click
- Update the button icon dynamically: `i-lucide-sun` for light, `i-lucide-moon` for dark, `i-lucide-monitor` for system
- Add a tooltip using `UTooltip` that shows the current active mode
::

API

Props

/**
 * Props for the ProseProsePrompt component
 */
interface ProseProsePromptProps {
  description?: string | undefined;
  icon?: any;
  /**
   * The `copy` action is always displayed, list any additional actions to show alongside it.
   * @default []
   */
  actions?: ("copy" | "cursor" | "windsurf" | "claude")[] | undefined;
  ui?: { root?: SlotClass; icon?: SlotClass; content?: SlotClass; description?: SlotClass; actions?: SlotClass; } | undefined;
}

Slots

/**
 * Slots for the ProsePrompt component
 */
interface ProsePromptSlots {
  default(): any;
}

테마 (Theme)

export default defineAppConfig({
  ui: {
    prose: {}
  }
})

변경 기록 (Changelog)

컴포넌트와 테마의 커밋 내역을 확인해 보세요.

더 알아보기 (Learn more)