55 lines
1.5 KiB
Markdown
55 lines
1.5 KiB
Markdown
# Input
|
|
|
|
Inputs are areas in which users can enter information. In Funkwhale, these mostly take the form of search fields.
|
|
|
|
| Prop | Data type | Required? | Description |
|
|
| --------------- | --------- | --------- | --------------------------------------------------------------------------- |
|
|
| `placeholder` | String | No | The placeholder text that appears when the input is empty. |
|
|
| `icon` | String | No | The [Bootstrap icon](https://icons.getbootstrap.com/) to show on the input. |
|
|
| `v-model:value` | String | Yes | The text entered in the input. |
|
|
|
|
## Input model
|
|
|
|
You can link a user's input to form data by referencing the data in a `v-model` directive.
|
|
|
|
```vue-html{2}
|
|
<fw-input
|
|
v-model="value"
|
|
placeholder="Search"
|
|
/>
|
|
```
|
|
|
|
<fw-input placeholder="Search" />
|
|
|
|
## Input icons
|
|
|
|
Add a [Bootstrap icon](https://icons.getbootstrap.com/) to an input to make its purpose more visually clear.
|
|
|
|
```vue-html{3}
|
|
<fw-input
|
|
v-model="value"
|
|
icon="bi-search"
|
|
placeholder="Search"
|
|
/>
|
|
```
|
|
|
|
<fw-input icon="bi-search" placeholder="Search" />
|
|
|
|
## Input-right slot
|
|
|
|
You can add a template on the right-hand side of the input to guide the user's input.
|
|
|
|
```vue-html{2-4}
|
|
<fw-input v-model="value" placeholder="Search">
|
|
<template #input-right>
|
|
suffix
|
|
</template>
|
|
</fw-input>
|
|
```
|
|
|
|
<fw-input placeholder="Search">
|
|
<template #input-right>
|
|
suffix
|
|
</template>
|
|
</fw-input>
|