input
Input label with tooltip
Input label with tooltip
Загрузка превью…
src/input/c-input-16.vue
<!--
Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
(lucide-react v0.545.0 "circle-question-mark", HelpCircleIcon) — см.
docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Field, FieldDescription, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
</script>
<template>
<Field class="max-w-xs">
<div class="flex items-center gap-2">
<FieldLabel for="username">Username</FieldLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger class="inline-flex items-center">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="lucide lucide-circle-question-mark text-muted-foreground size-3.5"
>
<circle cx="12" cy="12" r="10" />
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
<path d="M12 17h.01" />
</svg>
</TooltipTrigger>
<TooltipContent>Your unique identifier on the platform.</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<Input id="username" placeholder="johndoe" />
<FieldDescription>Your unique identifier on the platform.</FieldDescription>
</Field>
</template>