<div data-slot='toast'>
<button
type='button'
data-slot='button'
data-variant='outline'
data-toast-title='Toast'
data-toast-description='A toast confirms an action and closes by itself.'
>
Show toast
</button>
<template data-slot='toast-template'>
<div data-slot='toast-item' role='status' aria-atomic='true'>
<div data-slot='toast-content'>
<div class='toast-text'>
<p data-slot='toast-title'></p>
<p data-slot='toast-description'></p>
</div>
<button
type='button'
data-slot='toast-action'
data-button
data-variant='outline'
data-size='sm'
>
Undo
</button>
<button type='button' data-slot='toast-close' aria-label='Close'>
<svg
class='icon'
data-slot='icon'
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
stroke-width='2'
stroke-linecap='round'
stroke-linejoin='round'
aria-hidden='true'
focusable='false'
>
<path d='M18 6 6 18M6 6l12 12'/>
</svg>
</button>
</div>
</div>
</template>
<section data-slot='toast-viewport' aria-label='Notifications'></section>
</div>Installation
npx shadcn@latest add https://ui.full.dev/r/liquid/toast.json https://ui.full.dev/r/liquid/icon.json
Follow the one-time layout setup. A full components install already includes this item.
Usage
After this install, render these once in the layout head before theme overrides and other modules. The full ui hook already includes them. The command also installs the parts used in this example.
{% render 'ui-init' %}
{% render 'ui-triggers' %}
{% render 'ui-button' %}
{% render 'ui-runtime' %}
{% render 'ui-toast' %}
{% render 'ui-icon' %}
The preview and its Usage tab render the same native Liquid source. Use data-slot for parts, data-variant for variants and data-size for sizes. Keep your store’s labels, translations and Shopify data in your theme.
Parts
drawer-backdrop, drawer-popup, toast-action, toast-close, toast-content, toast-description, toast-item, toast-title, toast-viewport.