- Fluid Reference Documentation
- Fluid 1.0.0

# SnackBar QML Type

SnackBar provides a brief feedback about an operation. More...

Import Statement: | import Fluid.Controls 1.0

- List of all members, including inherited members

## Properties

- duration : int
- fullWidth : bool
- opened : bool

## Signals

- clicked()

## Methods

- void close()
- void open(string text, string buttonText)

## Detailed Description

      Page {
          title: qsTr("Send a message")

          Button {
              anchors.centerIn: parent
              text: qsTr("Send Message")
              onClicked: snackBar.open(qsTr("Message sent"))
          }

          SnackBar {
              id: snackBar
          }
      }

SnackBar provides a brief feedback about an operation through a message at the bottom of the screen.

It contains a single line of text directly related to the operation performed. There can be a text action, but no icons.

For more information you can read the Material Design guidelines.

## Property Documentation

duration : int

Amount of time (in ms) to keep the notification visible. The default is 2s.

fullWidth : bool

Whether the bar should take full screen width. The default depends on the device: full width only on phones and tablets.

[read-only] opened : bool

Whether the snack bar is currently open or not.

## Signal Documentation

clicked()

This signal is emitted when the button is clicked. The handler is `onClicked`.

## Method Documentation

void close()

Close the bar.

void open(string text, string buttonText = "")

Open the bar with the specified text and buttonText.