Oddmash UI
すべてのコンポーネント

Alert

重要なメッセージの確認を求めます。

使い方

確認には AlertDialog、インラインの状態には Alert を使用します。

アクセシビリティ

モーダルはフォーカスを保持し、確認後に戻します。インライン通知には role="alert" を使えます。

プロパティ型既定値
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>
    </>
  );
};

インタラクティブなドキュメント