> For the complete documentation index, see [llms.txt](https://dormakaba-digital.gitbook.io/reactnative-client/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dormakaba-digital.gitbook.io/reactnative-client/concerns/snacks.md).

# Global / Local Snacks

Lets you show global are local (bound eg. to a form) notifications.

![](https://575178918-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LJE3_EDCpa94OXGCnIX%2F-LJIt3CDGK0MhlD6iU1f%2F-LJItWAjGNbCChIairek%2Fsnack.gif?alt=media\&token=383731d0-5445-47d2-91c4-4123529984cc)

## Code sample

```jsx
import { Snack } from '@dormakaba/digital-reactnative-client';

<View>
  <Snack.Global />
  <View>
    <Snack.Local restricted="someForm" />
    <Text>Form:</Text>
  </View>
</View>

const message ={
  message: 'Hello'
};

// show a snack
Snack.show(message);

// hide a snack if not set to be dismissed automatically
Snack.hide(messageId);
```

the message has following options:

| Property   | Default | Description                                                                                                                            |
| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| id         | uuid.v4 | An unique id for the notification -> can be used for `Snack.hide(id)`                                                                  |
| message    |         | text to show in the notification                                                                                                       |
| restricted |         | set this to show the message on a `Snack.Local` if not set it will be shown globally                                                   |
| dismiss    | 5000    | message will be removed after this time; if restricted is set dismiss won't have a default value and it won't be removed automatically |
| type       | info    | any string of: `info`, `success`, `warning`, `error`                                                                                   |
