Snackbar

ARIA
RTL

The snackbar component is a non-disruptive message that appears on the interface to provide quick, at-a-glance feedback on the outcome of an action.

Based on Radix.

Snackbar

Anatomy

<Snackbar>
  <Snackbar.Icon>...</Snackbar.Icon>
  <Snackbar.Content>
    <Snackbar.Header>...</Snackbar.Header>
    <Snackbar.Message>...</Snackbar.Message>
  </Snackbar.Content>
  <Snackbar.Close />
</Snackbar>

Default

    Positions

                Options

                            Semantic types

                                  Auto close

                                      Customization

                                                  Snackbar Queue

                                                    Snackbar props

                                                    NameTypeRequiredDefaultDescription
                                                    autoClosenumberNo5000Duration the snackbar takes in ms.
                                                    childrenReact.ReactNodeNo-Children content
                                                    classNamestringNo-Tailwind classes for customization
                                                    isOpenbooleanYesfalseToggles visibility of Snackbar
                                                    positiontop-left | top-center | top-right | bottom-left | bottom-center | bottom-rightNotop-rightPosition of snackbar
                                                    onOpenChange() => voidYes-Event handler called when the open state of the dialog changes

                                                    Snackbar.Content props

                                                    NameTypeRequiredDefaultDescription
                                                    childrenReact.ReactNodeNo-Children content
                                                    classNamestringNo-Tailwind classes for customization

                                                    Snackbar.Header props

                                                    NameTypeRequiredDefaultDescription
                                                    childrenReact.ReactNodeNo-Children content
                                                    classNamestringNo-Tailwind classes for customization

                                                    Snackbar.Message props

                                                    NameTypeRequiredDefaultDescription
                                                    childrenReact.ReactNodeNo-Children content
                                                    classNamestringNo-Tailwind classes for customization

                                                    Snackbar.Icon props

                                                    NameTypeRequiredDefaultDescription
                                                    childrenReact.ReactNodeNo-Children content
                                                    classNamestringNo-Tailwind classes for customization

                                                    Snackbar.Close props

                                                    NameTypeRequiredDefaultDescription
                                                    ariaLabelstringNoCloseAria-label for close button
                                                    classNamestringNo-Tailwind classes for customization