docs(input): add examples

This commit is contained in:
Benjamin Canac
2024-10-18 15:19:10 +02:00
parent d407c42be7
commit 9359603a0a
9 changed files with 292 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
<script setup lang="ts">
const value = ref('')
const maxLength = 15
</script>
<template>
<UInput
v-model="value"
:maxlength="maxLength"
aria-describedby="character-count"
:ui="{ trailing: 'pointer-events-none' }"
>
<template #trailing>
<div
id="character-count"
class="text-xs text-[var(--ui-text-muted)] tabular-nums"
aria-live="polite"
role="status"
>
{{ value?.length }}/{{ maxLength }}
</div>
</template>
</UInput>
</template>