Skip to content

Toast

A lightweight feedback message that appears briefly and disappears automatically. Supports multiple types and imperative invocation.

Basic Usage

vue
<script setup>
import { ref } from 'vue'
const show = ref(false)
</script>

<template>
  <see-toast v-model:show="show" message="Operation successful" type="success" />
</template>

Imperative Usage

ts
import { useToast } from 'see-u-ui'

const toast = useToast()

toast.success('Operation successful')
toast.error('Something went wrong')
toast.warning('Please check your input')
toast.info('Tips: ...')
toast.loading('Loading...')

Props

PropTypeDefaultDescription
showbooleanfalseWhether to show the toast
messagestring''Toast message text
typestring'default'Toast type: success, error, warning, info, loading, default
iconstring''Custom icon
durationnumber2000Display duration in ms
positionstring'center'Position: center, top, bottom

Events

EventParametersDescription
onClose-Triggered when toast closes
update:show(value: boolean)Triggered when show state changes

Liao ICP No. 2025070134