Skip to content

Commit

Permalink
feat(components): field
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <[email protected]>
  • Loading branch information
ZTL-UwU committed May 30, 2024
1 parent 7c0f220 commit b795b7f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/content/CodeGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function render() {
return h(
UiCard,
[
() => [
h(
CodeGroupHeader,
{
Expand Down
29 changes: 29 additions & 0 deletions components/content/Field.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div class="[&:not(:first-child)]:mt-4">
<div class="flex mb-2 space-x-2">
<span class="font-bold text-md text-primary">
{{ name }}
</span>
<span v-if="required" class="self-center font-mono text-sm text-muted-foreground">
required
</span>
<span class="flex-1" />
<span class="self-center font-mono text-sm text-muted-foreground">
{{ type }}
</span>
</div>
<span class="text-sm">
<ContentSlot unwrap="p" />
{{ description }}
</span>
</div>
</template>

<script setup lang="ts">
defineProps<{
name: string;
type?: string;
required?: boolean;
description?: string;
}>();
</script>
17 changes: 17 additions & 0 deletions content/1.getting-started/3.writing/2.components.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,23 @@ npm i -D @iconify-json/collection-name
```
::

### Field

:badge[Nuxt UI Pro]{variant="outline" to="https://ui.nuxt.com/pro/prose/field" target="_blank"}

::code-group
::preview{filename="Preview"}
::field{name="Field" type="string" required}
The `description` can be set as prop or in the default slot with full **markdown** support.
::
::
```md [Code]
::field{name="Field" type="string" required}
The `description` can be set as prop or in the default slot with full **markdown** support.
::
```
::

## Landing Page Components

### Hero
Expand Down

0 comments on commit b795b7f

Please sign in to comment.