Skip to content

SnackBar

A lightweight message with an optional action which briefly displays at the bottom of the screen.

Usage

vue
<template>
  <Button @click="showSnackBar">Show SnackBar</Button>
</template>

<script setup lang="ts">
import { Button, SnackBar } from "fluekit";

const showSnackBar = () => {
  SnackBar.show({
    content: "This is a SnackBar!",
    actionLabel: "Undo",
    onAction: () => console.log("Undo clicked"),
  });
};
</script>

API

Props

NameTypeDefaultDescription
contentstring-The content of the SnackBar.
actionLabelstring-The label for the optional action button.
durationnumber4000The duration in milliseconds for which the SnackBar is visible.

Events

NameDescription
actionCalled when the action button is pressed.
closeCalled when the SnackBar is closed.