feat(Alert/Toast)!: add orientation prop

This commit is contained in:
Benjamin Canac
2025-02-05 13:36:46 +01:00
parent cd0a9d39d8
commit 2c192ac145
15 changed files with 659 additions and 347 deletions

View File

@@ -0,0 +1,27 @@
<script setup lang="ts">
const toast = useToast()
const props = defineProps<{
orientation: 'horizontal' | 'vertical'
}>()
function showToast() {
toast.add({
title: 'Uh oh! Something went wrong.',
orientation: props.orientation,
actions: [{
icon: 'i-lucide-refresh-cw',
label: 'Retry',
color: 'neutral',
variant: 'outline',
onClick: (e) => {
e?.stopPropagation()
}
}]
})
}
</script>
<template>
<UButton label="Show toast" color="neutral" variant="outline" @click="showToast" />
</template>