Alert
중요한 메시지의 확인을 요청합니다.
사용법
확인이 필요한 경우 AlertDialog, 인라인 상태에는 Alert를 사용하세요.
접근성
모달은 포커스를 유지하고 확인 후 복원합니다. 인라인 알림에는 role="alert"를 사용할 수 있습니다.
| 속성 | 타입 | 기본값 |
|---|---|---|
| open | boolean | Required |
| title | string | Required |
| onConfirm | () => void | Required |
| confirmLabel | string | OK |
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>
</>
);
};