mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs(input): add examples
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
const show = ref(false)
|
||||
const password = ref('password')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UInput
|
||||
v-model="password"
|
||||
placeholder="Password"
|
||||
:type="show ? 'text' : 'password'"
|
||||
:ui="{ trailing: 'pr-0.5' }"
|
||||
>
|
||||
<template #trailing>
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="link"
|
||||
size="sm"
|
||||
:icon="show ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
|
||||
aria-label="show ? 'Hide password' : 'Show password'"
|
||||
:aria-pressed="show"
|
||||
aria-controls="password"
|
||||
@click="show = !show"
|
||||
/>
|
||||
</template>
|
||||
</UInput>
|
||||
</template>
|
||||
Reference in New Issue
Block a user