shadcn-vue/apps/www/src/lib/registry/default/example/SheetSideDemo.vue
Selemondev e5cecae352
docs: Improve the API reference of all the components (#152)
* docs: improve the api reference of all the components

* docs(app): #152 add new-york theme

This pull request is intended to add the new-york theme for the newly created component examples.

Closes: #152

* chore: build registry

* chore: change usage of lucide icon in new-york

---------

Co-authored-by: zernonia <zernonia@gmail.com>
2023-11-09 18:42:01 +08:00

58 lines
1.7 KiB
Vue

<script setup lang="ts">
import { ref } from 'vue'
import { Button } from '@/lib/registry/default/ui/button'
import { Input } from '@/lib/registry/default/ui/input'
import { Label } from '@/lib/registry/default/ui/label'
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from '@/lib/registry/default/ui/sheet'
const SHEET_SIDES = ['top', 'right', 'bottom', 'left'] as const
const username = ref('')
</script>
<template>
<div class="grid grid-cols-2 gap-2">
<Sheet v-for="side in SHEET_SIDES" :key="side">
<SheetTrigger as-child>
<Button variant="outline">
{{ side }}
</Button>
</SheetTrigger>
<SheetContent :side="side">
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<div class="grid gap-4 py-4">
<div class="grid items-center grid-cols-4 gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" v-model="username" class="col-span-3" />
</div>
<div class="grid items-center grid-cols-4 gap-4">
<Label for="username" class="text-right">Username</Label>
<Input id="username" v-model="username" class="col-span-3" />
</div>
</div>
<SheetFooter>
<SheetClose as-child>
<Button type="submit">
Save changes
</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
</div>
</template>