Pular para o conteúdo principal

Toast

Import

import { Toast } from '@resultadosdigitais/tangram-components'

Properties

delay

Typenumber
Defaultundefined

Description

Sets the number of milliseconds to wait before automatically calling the onClose function. onClose should be passed by props.

message

Typestring | node
Default''

Description

Sets if content of Toast will be customizable.

// Can be a string:
<Toast title="Toast title" message="Toast message content" />

// Or a node as like Toast.Text:
<Toast
title="Toast title"
message={<Toast.Text>Toast message content</Toast.Text>}
/>

title

Typestring
Default''

Description

Sets the title.

kind

Type
Enum of:
  • Toast.kinds.default
  • Toast.kinds.primary
  • Toast.kinds.success
  • Toast.kinds.danger
  • Toast.kinds.warning
  • Toast.kinds.help
DefaultToast.kinds.default

Description

Sets the kind for styling.

show 🗑️

Concerns
🗑️ Deprecated: - Use `hide` property instead.
Typebool
Defaulttrue

Description

Sets when the Toast will be shown or not.

hide

Typebool
Defaultfalse

Description

Sets when the Toast will be hidden or not.

onClose

Typefunc
Default() => {}
Paramevent React.SyntheticEvent - The event source of the callback.

Description

Callback fired when the Toast closure is requested, and before starting the animation, like when the close button is clicked.

onRemoved

Typefunc
Default() => {}
Paramevent React.SyntheticEvent - The event source of the callback.

Description

Callback fired when the Toast is completely removed (after animation).

dismissible 🗑️

Concerns
🗑️ Deprecated: - Use `irremovable` property instead.
Typebool
Defaulttrue

Description

Sets if the Toast is dismissible making available a button that when clicked closes the snackbar.

irremovable

Typebool
Defaultfalse

Description

Sets if the Toast is irremovable by hiding the close button.

icon

Typeelement

Description

Sets the custom icon.

children

Typenode
Defaultnull

Description

Sets the children.

action 🗑️

Concerns
🗑️ Deprecated
Typenode

Description

Sets elements for action area.

<ToastProvider />

Import

import { ToastProvider } from '@resultadosdigitais/tangram-components'

Properties

delay

Typenumber
Default7000
Description

Sets the number of milliseconds to wait before automatically calling the onClose function. onClose should be passed by props. This behavior is disabled by default.

kind

Type
Enum of:
  • Toast.kinds.default
  • Toast.kinds.primary
  • Toast.kinds.success
  • Toast.kinds.danger
  • Toast.kinds.warning
  • Toast.kinds.help
DefaultToast.kinds.default
Description

Sets the kind for styling.

children

Typenode
Defaultnull
Description

Sets the children.

Feedback