Oddmash UI
All components

Alert

Require acknowledgment of an important message.

Usage

Use AlertDialog for acknowledgment and Alert for inline status.

Accessibility

The modal traps focus and restores it on confirmation. Inline alerts can use role="alert".

PropertyTypeDefault
openbooleanRequired
titlestringRequired
onConfirm() => voidRequired
confirmLabelstringOK
import { useState } from 'react';

export const RecordingNotice = () => {
  const [visible, setVisible] = useState(false);

  return (
    <>
      <Button onClick={() => setVisible(true)}>Show alert</Button>
      <AlertDialog open={visible} title="Recording stopped" onConfirm={() => setVisible(false)}>
        Reconnect the inspector to continue capturing events.
      </AlertDialog>
    </>
  );
};

Interactive documentation