docs(ComponentCard): show all props for the code (#797)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
KeJun
2023-10-15 23:52:20 +08:00
committed by GitHub
parent 9f4d88e0aa
commit 8867936e01
16 changed files with 157 additions and 99 deletions

View File

@@ -10,13 +10,12 @@ links:
## Usage
Use the FormGroup component around an [Input](/forms/input), [Textarea](/forms/textarea), [Select](/forms/select) or a [SelectMenu](/forms/select-menu) with the `name` prop to automatically associate a `<label>` element with the form element.
Use the FormGroup component around an [Input](/forms/input), [Textarea](/forms/textarea), [Select](/forms/select) or a [SelectMenu](/forms/select-menu) with a `label`. The `<label>` will automatically be associated with the form element so it gets focused on click.
::component-card
---
props:
label: 'Email'
name: 'email'
code: >-
<UInput placeholder="you@example.com" icon="i-heroicons-envelope" />
@@ -32,8 +31,6 @@ Use the `required` prop to indicate that the form element is required.
::component-card
---
baseProps:
name: 'group-required'
props:
label: 'Email'
required: true
@@ -52,8 +49,6 @@ Use the `description` prop to display a description below the label.
::component-card
---
baseProps:
name: 'group-description'
props:
label: 'Email'
description: "We'll only use this for spam."
@@ -72,8 +67,6 @@ Use the `hint` prop to display a hint above the form element.
::component-card
---
baseProps:
name: 'group-hint'
props:
label: 'Email'
hint: 'Optional'
@@ -92,8 +85,6 @@ Use the `help` prop to display an help message below the form element.
::component-card
---
baseProps:
name: 'group-help'
props:
label: 'Email'
help: 'We will never share your email with anyone else.'
@@ -122,8 +113,6 @@ You can also use the `error` prop as a boolean to mark the form element as inval
::component-card
---
baseProps:
name: 'group-error'
props:
label: 'Email'
error: true