Pear

PInput

PInput handles the native odds and ends too: color pickers and file inputs, with the same field and v-model shape as the text inputs.

Color Picker
vue
<p-field label="Favorite color">
  <p-input v-model="favoriteColor" type="color" name="favorite-color" />
</p-field>
File Upload
No file selected
vue
<p-field label="Receipt" :helper="selectedFileName">
  <p-input v-model="receipt" type="file" name="receipt" accept=".pdf,image/*" />
</p-field>
Multiple Files
No files selected
vue
<p-field label="Attachments" :helper="selectedAttachmentNames">
  <p-input
    v-model="attachments"
    type="file"
    name="attachments"
    accept=".pdf,image/*"
    multiple
  />
</p-field>
API

Color Input Props

NameTypeDefaultDescription
v-modelstring-Selected color as a native color input string, usually a hex value such as #00dfa2.
type'color'-Renders a native color picker input.
disabledbooleanfalseDisables the color picker. Inherits from PField when present.
invalidbooleanfalseSets aria-invalid. Inherits from PField when present.
tooltipstring-Optional Pico tooltip content.
tooltipPlacementPTooltipPlacement-Optional Pico tooltip placement.

Color Input Events

NameTypeDefaultDescription
update:modelValuestring-Emitted by v-model when the selected color changes.

File Input Props

NameTypeDefaultDescription
v-modelFileList | null-Selected files from the native file input.
type'file'-Renders a native file upload input.
acceptstring-Native file type filter passed through as an attribute, such as .pdf,image/*.
multiplebooleanfalseNative multiple file selection passed through as an attribute.
disabledbooleanfalseDisables the file input. Inherits from PField when present.
invalidbooleanfalseSets aria-invalid. Inherits from PField when present.
tooltipstring-Optional Pico tooltip content.
tooltipPlacementPTooltipPlacement-Optional Pico tooltip placement.

File Input Events

NameTypeDefaultDescription
update:modelValueFileList | null-Emitted by v-model when the selected files change.