diff --git a/.changeset/fresh-bobcats-attack.md b/.changeset/fresh-bobcats-attack.md new file mode 100644 index 0000000..095f019 --- /dev/null +++ b/.changeset/fresh-bobcats-attack.md @@ -0,0 +1,5 @@ +--- +"@svecodocs/kit": patch +--- + +fix: cleanup empty space if no `defaultValue` or `required` in prop field diff --git a/packages/kit/src/lib/components/prop-field.svelte b/packages/kit/src/lib/components/prop-field.svelte index a1bac89..4bfeb52 100644 --- a/packages/kit/src/lib/components/prop-field.svelte +++ b/packages/kit/src/lib/components/prop-field.svelte @@ -41,24 +41,27 @@ {@render children?.()} {/if} -
- {#if defaultValue} -
- - default: - - - {defaultValue} + + {#if defaultValue || required} +
+ {#if defaultValue} +
+ + default: + + + {defaultValue} + +
+ {/if} + {#if required} + + required -
- {/if} - {#if required} - - required - - {/if} -
+ {/if} +
+ {/if}