checkbox
Custom positioned checkbox
Custom positioned checkbox
Загрузка превью…
src/checkbox/c-checkbox-14.vue
<!--
Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
(lucide-react v0.545.0 "circle-dollar-sign"/"file-text"/"credit-card"/
"chart-no-axes-column-decreasing") — см. docs/PORTING.md §5. Исходный
`items.map(...)` развёрнут в явную разметку: массив хранил JSX-иконки
напрямую (`ReactNode`), для чего во Vue нет дешёвого эквивалента
(правило 2), а развёрнутая разметка даёт идентичный DOM.
-->
<script setup lang="ts">
import { Checkbox } from "@/components/ui/checkbox"
import { Field, FieldGroup, FieldLabel, FieldTitle } from "@/components/ui/field"
</script>
<template>
<FieldGroup class="grid w-full max-w-xs grid-cols-2 gap-4">
<FieldLabel class="relative p-0">
<Field orientation="horizontal">
<Checkbox :default-value="true" class="absolute top-3 right-3 size-5 rounded-full" />
<FieldTitle class="flex flex-col items-start">
<div class="bg-background border-border rounded-2xl flex shrink-0 items-center justify-center border p-2 shadow-xs shadow-black/5">
<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"
aria-hidden="true"
class="lucide lucide-circle-dollar-sign size-4"
>
<circle cx="12" cy="12" r="10" />
<path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8" />
<path d="M12 18V6" />
</svg>
</div>
<div class="flex flex-col items-start gap-0.5">
<span class="text-sm font-semibold">Payments</span>
<span class="text-muted-foreground text-xs">Receive payments from your customers</span>
</div>
</FieldTitle>
</Field>
</FieldLabel>
<FieldLabel class="relative p-0">
<Field orientation="horizontal">
<Checkbox class="absolute top-3 right-3 size-5 rounded-full" />
<FieldTitle class="flex flex-col items-start">
<div class="bg-background border-border rounded-2xl flex shrink-0 items-center justify-center border p-2 shadow-xs shadow-black/5">
<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"
aria-hidden="true"
class="lucide lucide-file-text size-4"
>
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" />
<path d="M14 2v4a2 2 0 0 0 2 2h4" />
<path d="M10 9H8" />
<path d="M16 13H8" />
<path d="M16 17H8" />
</svg>
</div>
<div class="flex flex-col items-start gap-0.5">
<span class="text-sm font-semibold">Invoices</span>
<span class="text-muted-foreground text-xs">Create and send invoices to your customers</span>
</div>
</FieldTitle>
</Field>
</FieldLabel>
<FieldLabel class="relative p-0">
<Field orientation="horizontal">
<Checkbox class="absolute top-3 right-3 size-5 rounded-full" />
<FieldTitle class="flex flex-col items-start">
<div class="bg-background border-border rounded-2xl flex shrink-0 items-center justify-center border p-2 shadow-xs shadow-black/5">
<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"
aria-hidden="true"
class="lucide lucide-credit-card size-4"
>
<rect width="20" height="14" x="2" y="5" rx="2" />
<line x1="2" x2="22" y1="10" y2="10" />
</svg>
</div>
<div class="flex flex-col items-start gap-0.5">
<span class="text-sm font-semibold">Billing</span>
<span class="text-muted-foreground text-xs">Manage your billing and subscriptions</span>
</div>
</FieldTitle>
</Field>
</FieldLabel>
<FieldLabel class="relative p-0">
<Field orientation="horizontal">
<Checkbox class="absolute top-3 right-3 size-5 rounded-full" />
<FieldTitle class="flex flex-col items-start">
<div class="bg-background border-border rounded-2xl flex shrink-0 items-center justify-center border p-2 shadow-xs shadow-black/5">
<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"
aria-hidden="true"
class="lucide lucide-chart-no-axes-column-decreasing size-4"
>
<path d="M5 21V3" />
<path d="M12 21V9" />
<path d="M19 21v-6" />
</svg>
</div>
<div class="flex flex-col items-start gap-0.5">
<span class="text-sm font-semibold">Reports</span>
<span class="text-muted-foreground text-xs">View your reports and analytics</span>
</div>
</FieldTitle>
</Field>
</FieldLabel>
</FieldGroup>
</template>