Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Toast

Install, props and the parts Toast is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/sonner.json

Use

<script setup lang="ts">
import { toast } from 'vue-sonner'
import { Toaster } from '@/components/ui/sonner'
</script>

<template>
  <div>
    <Toaster />
    <button type="button" @click="toast.success('Order exported')">Export</button>
  </div>
</template>

Props

Part Prop Values Notes
Toaster position, expand, close-button vue-sonner props Mount one per app
toast .success, .info, .warning, .error, .promise functions

Built on

vue-sonner, as the shadcn-vue Sonner. Beehexa replaces its look with tokens.