| name | write-component-jsdocs |
| description | Guide for writing JSDoc comments on vapor-ui components and their props. Use when adding, reviewing, or fixing JSDoc on component tsx files or css.ts variant files. Covers where to place comments based on component pattern โ standalone, compound root, compound sub-part โ language and format rules, and a checklist for review. Triggers on requests like add jsdocs, write component docs, document props, jsdoc ์์ฑ, or when reviewing a component documentation completeness. |
| argument-hint | ComponentName โ the PascalCase component name to document (e.g. Button, Dialog, Avatar). Required. When provided, locate the component under packages/core/src/components/{kebab-case-name}/ and apply this guide to those files only. |
JSDoc Component Guide
JSDoc in vapor-ui is user-facing UI, not internal code comments. Write it for developers who encounter the component for the first time via documentation sites (Storybook Autodocs, etc.).
Core rules
- Language: English only. No Korean in JSDoc blocks.
- Format: Always leave the first line of every
/** ... */ block empty.
- Placement: Write the component summary above the component function. Write individual prop descriptions inside the Props interface/type, not on the component function.
Where to write
Placement depends on the component pattern. See references/guide.md for detailed patterns and examples.
| Target | File | Location |
|---|
| Component summary | {component}.tsx | Above the component function |
| Individual props | {component}.tsx | Inside the interface or namespace Props |
| Variant groups | {component}.css.ts | On each variant key object inside componentRecipe() |
Do NOT write JSDoc on:
- Individual variant values (
sm, md, primary, fill, etc.) โ the variant key description is sufficient
export type XxxVariants โ tooling derives this from the recipe automatically
Pattern quick-reference
- Standalone โ no JSDoc on namespace
Props itself; write variant group docs in componentRecipe() in .css.ts
- Compound Root (custom props via
interface) โ write on the interface, namespace wraps it
- Compound Root with context (
Assign<โฆ, Context> pattern) โ write only on custom props
- Compound sub-part (
Omit<โฆ, keyof Context> pattern) โ write only on remaining props
Component summary rules
- One single line โ no line breaks inside the summary
- User perspective: what it is โ when to use it
- No internal terms (
memoized, wrapper, token-based, etc.)
- End with the rendered HTML element using backticks around the tag: "Renders a
<button> element." or "Doesn't render its own HTML element.".
Prop description rules
- Don't repeat the prop name or its type
- Describe side effects and interactions with other props
- For numeric props: include unit and valid range
- For event handlers: specify the exact trigger condition, not just "handler"
- Use the
@default JSDoc tag to indicate default values โ never write Default: \value`` inline in the description text
Review checklist
See the full checklist in references/guide.md.
Quick checklist: