Toaster

The viewport component that renders toasts. Add it once to your layout.

import { Toaster } from "sileo";
PropTypeDefaultDescription
childrenReactNodeApp content to render alongside toasts
positionSileoPosition"top-right"Default position for all toasts
offsetnumber | string | objectDistance from viewport edges
optionsPartial<SileoOptions>Default options merged into every toast
theme"light" | "dark" | "system"Automatically sets fill based on color scheme. system follows the OS preference

Offset

The offset prop accepts a number, string, or per-side config.

<Toaster offset={20} />

<Toaster offset={{ top: 20, right: 16 }} />

Default Options

Set global defaults that apply to every toast.

<Toaster
  options={{
    fill: "#171717",
    styles: { description: "text-white/75!" },
  }}
/>

SileoPosition

type SileoPosition =
  | "top-left"
  | "top-center"
  | "top-right"
  | "bottom-left"
  | "bottom-center"
  | "bottom-right";