CreateIncidentDrawer
When to use
Section titled “When to use”Store ops workflows that file incidents from Whisker modules. Pairs with IncidentsWidget for read + create flows.
When NOT to use
Section titled “When NOT to use”Generic forms — build with Podium inputs. Non-incident ticketing — this is ServiceNow-specific.
Podium primitives composed
Section titled “Podium primitives composed”- Podium
TextField - Podium
Select - Podium
Button - Podium
Drawer
Required providers
Section titled “Required providers”- NikeStoreProvider
- SlideOutProvider
Auto-generated from
src/components/CreateIncidentDrawer/CreateIncidentDrawer.types.ts. Do not edit by hand. Runpnpm docs:propsafter changing source JSDoc.
CreateIncidentDrawerProps
Section titled “CreateIncidentDrawerProps”| Prop | Type | Required | Description |
|---|---|---|---|
accessToken |
null | string |
Yes | SIM user JWT (Okta or Retail) used as Authorization: Bearer <token> on every BFF call. When null, all incident requests will fail with a 401 — the host should keep this in sync with its auth store. |
allowScreenCapture |
boolean |
No | When true, renders a ScreenCaptureUpload field in the form so users can attach a screenshot or PDF to the incident report. Default: false |
apiConfig |
IncidentApiConfig |
Yes | BFF endpoint configuration |
disabled |
boolean |
No | Disables the trigger button. |
onClose |
() => void |
No | Controlled mode: called when the drawer requests to close. Required when open is provided. |
onError |
(error: Error) => void |
No | Called when any API error occurs during form load or submission. |
onScreenshotChange |
(file: File | null) => void |
No | Called whenever the selected screenshot file changes (or is cleared). Useful if the parent needs to handle the upload separately. |
onSuccess |
(incidentNumber: string) => void |
No | Called with the incident number string when the incident is successfully created. Use this to show a toast, redirect, or refresh data. |
open |
boolean |
No | Controlled mode: when provided, the drawer open state is controlled externally and the built-in trigger button is hidden. |
services |
IncidentServices |
No | Injectable service overrides. Pass mock implementations for Storybook stories and tests; omit to use the real BFF proxy. |
triggerLabel |
string |
No | Label for the button that opens the drawer. Default: 'Create Incident' |
Examples
Section titled “Examples”Open incident drawer
Section titled “Open incident drawer”import { CreateIncidentDrawer } from '@nike/whisker-component-library';
<CreateIncidentDrawer open={open} onOpenChange={setOpen} accessToken={token} apiConfig={{ baseUrl: '/sim-bff/incidents' }} onCreated={(result) => console.log(result.incidentNumber)}/>;