k8ordo
  • UI
  • Form
  • State
  • Router
  • Static
  • Server
Switch to dark mode
  • Get Started
  • Theming
  • i18n
  • Components
  • Hooks
  • Helpers
  • AI
Open navigation
Buttons
  • Button
  • IconButton
Navigation
  • Anchor
  • Tabs
  • Breadcrumb
  • Pagination
Forms
  • TextField
  • Textarea
  • NumberField
  • Select
  • Checkbox
  • CheckboxCard
  • CheckboxGroup
  • Switch
  • PasswordInput
  • Radio
  • RadioCard
  • Autocomplete
  • Slider
  • FileField
  • FormControl
  • Form
Data Display
  • Accordion
  • Avatar
  • Badge
  • Card
  • Code
  • Table
  • Heading
Feedback
  • Alert
  • Skeleton
  • Spinner
  • Toast
  • Progress
Overlays
  • Dialog
  • Drawer
  • Modal
  • Popover
  • DropdownMenu
  • Tooltip
  • ListBox
Layout
  • Stack
  • Grid
  • Separator
  • ScrollLinked
Media
  • Icons
k8ordo

React libraries that use Baseline features without holding back.

Packages
  • @k8ordo/ui
  • @k8ordo/form
  • @k8ordo/state
  • @k8ordo/router
  • @k8ordo/static
  • @k8ordo/server
UI
  • Get Started
  • Theming
  • i18n
  • Components
  • Hooks
  • Helpers
  • AI Chat
  • Generative UI
  • AI Agents
  • Storybook
Resources
  • GitHub
  • npm

© 2026 k8o — MIT License

Typeset in Noto Sans JP & M PLUS 2

Components

Buttons
  • Button
  • IconButton
Navigation
  • Anchor
  • Tabs
  • Breadcrumb
  • Pagination
Forms
  • TextField
  • Textarea
  • NumberField
  • Select
  • Checkbox
  • CheckboxCard
  • CheckboxGroup
  • Switch
  • PasswordInput
  • Radio
  • RadioCard
  • Autocomplete
  • Slider
  • FileField
  • FormControl
  • Form
Data Display
  • Accordion
  • Avatar
  • Badge
  • Card
  • Code
  • Table
  • Heading
Feedback
  • Alert
  • Skeleton
  • Spinner
  • Toast
  • Progress
Overlays
  • Dialog
  • Drawer
  • Modal
  • Popover
  • DropdownMenu
  • Tooltip
  • ListBox
Layout
  • Stack
  • Grid
  • Separator
  • ScrollLinked
Media
  • Icons

Toast

A toast for temporary notification messages.

View in Storybook

Import

Usage

Basic Usage

useToast Hook

Close All

Props

ToastProvider

children?
Type: ReactNode
Default: -
portalRef?
Type: RefObject<HTMLElement | null>
Default: null
position?
Type: 'fixed'|'absolute'
Default: 'fixed'
PropTypeDefault
children?ReactNode-
portalRef?RefObject<HTMLElement | null>null
position?'fixed'|'absolute''fixed'

useToast

open
Type: (tone: Status, message: string, options?: ToastOptions) => void
Default: -
close
Type: (id: string) => void
Default: -
closeAll
Type: () => void
Default: -
PropTypeDefault
open(tone: Status, message: string, options?: ToastOptions) => void-
close(id: string) => void-
closeAll() => void-
import { ToastProvider, useToast } from '@k8ordo/ui';
<ToastProvider>
  <ToastDemo />
</ToastProvider>

function ToastDemo() {
  const { open } = useToast();

  return (
    <div className="flex flex-wrap gap-2">
      <Button onClick={() => open('success', 'Operation completed')}>
        Success
      </Button>
      <Button onClick={() => open('info', 'Here is some information')}>
        Info
      </Button>
      <Button onClick={() => open('warning', 'Please check your input')}>
        Warning
      </Button>
      <Button onClick={() => open('error', 'Something went wrong')}>
        Error
      </Button>
    </div>
  );
}
const { open, close, closeAll } = useToast();

// Show a toast
open('success', 'Saved successfully');

// Close a specific toast by ID
close(toastId);

// Close all toasts
closeAll();
function CloseAllDemo() {
  const { open, closeAll } = useToast();

  return (
    <div className="flex flex-wrap gap-2">
      <Button onClick={() => open('info', 'Notification 1')}>
        Add Toast
      </Button>
      <Button onClick={() => open('success', 'Notification 2')}>
        Add Another
      </Button>
      <Button onClick={closeAll}>Close All</Button>
    </div>
  );
}