Files
flowbite-vue/docs/guide/dropdown/examples/DropdownPlacementExample.vue
2022-07-11 15:49:24 +03:00

41 lines
2.3 KiB
Vue

<template>
<div class="vp-raw inline-flex align-center gap-2 flex-wrap">
<dropdown placement="bottom" text="Bottom">
Any content here
</dropdown>
<dropdown placement="top">
<template #trigger="{ toggle }">
<Button @click="toggle">
Top
<template #suffix>
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
</template>
</Button>
</template>
<div class="w-48 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<a href="#" aria-current="true" class="block w-full px-4 py-2 text-white bg-blue-700 border-b border-gray-200 rounded-t-lg cursor-pointer dark:bg-gray-800 dark:border-gray-600">
Profile
</a>
<a href="#" class="block w-full px-4 py-2 border-b border-gray-200 cursor-pointer hover:bg-gray-100 hover:text-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-500 dark:focus:text-white">
Settings
</a>
<a href="#" class="block w-full px-4 py-2 border-b border-gray-200 cursor-pointer hover:bg-gray-100 hover:text-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-500 dark:focus:text-white">
Messages
</a>
<a href="#" class="block w-full px-4 py-2 rounded-b-lg cursor-pointer hover:bg-gray-100 hover:text-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-500 dark:focus:text-white">
Download
</a>
</div>
</dropdown>
<dropdown placement="right" text="Right">
<Spinner size="6" class="m-4" />
</dropdown>
<dropdown placement="left" text="Left">
hello world
</dropdown>
</div>
</template>
<script setup>
import { Dropdown, Spinner, Button } from '../../../../src/index'
</script>