Skip to content
On this page

Form Group

Form label, caption, and other stuff.

Usage

Simple Usage

preview
vue
<template>
  <p-form-group label="First Name">
    <p-input />
  </p-form-group>
</template>

Advance Usage

This is description

preview
vue
<template>
  <p-form-group
    label="First Name"
    caption="This is caption"
    description="This is description"
    hint="This is hint"
    required>
    <p-input />
  </p-form-group>
</template>

Required Mode

Add little marker for required form using prop required.

preview
vue
<template>
  <p-form-group
    label="First Name"
    required>
    <p-input />
  </p-form-group>
</template>

Caption

Add sub-label using caption prop.

preview
vue
<template>
  <p-form-group
    label="First Name"
    caption="Lorem Ipsum dolor sitar">
    <p-input />
  </p-form-group>
</template>

Description

Add decription note below the form input using description prop.

Lorem Ipsum dolor sitar

preview
vue
<template>
  <p-form-group
    label="First Name"
    description="Lorem Ipsum dolor sitar">
    <p-input />
  </p-form-group>
</template>

Error Message

Error message from validation can be add in here using prop error. Note, it'll replace description message.

Please fill this field

preview
vue
<template>
  <p-form-group
    label="First Name"
    description="Lorem Ipsum dolor sitar"
    error="Please fill this field">
    <p-input />
  </p-form-group>
</template>

Hint tooltip

Easy add hint tooltip using prop hint.

preview
vue
<template>
  <p-form-group
    label="First Name"
    hint="Lorem Ipsum dolor sitar">
    <p-input />
  </p-form-group>
</template>

API

Props

PropsTypeDefaultDescription
labelString-Form group label
requiredBooleanfalseRequired flag
captionString-Sublabel caption
descriptionString-Description note
hintString-Tooltip hint
errorString-Error validation message

Slots

NameDescription
There no slots here

Events

NameArgumentsDescription
There no event here

Released under the MIT License.