+ The button will become enabled after five seconds.
+
+
+
+
+ );
+};
diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/useDelayedState.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/useDelayedState.tsx
new file mode 100644
index 0000000000000..4f1c601e06ce7
--- /dev/null
+++ b/js_modules/dagster-ui/packages/ui-components/src/components/useDelayedState.tsx
@@ -0,0 +1,12 @@
+import * as React from 'react';
+
+export const useDelayedState = (delayMsec: number) => {
+ const [value, setValue] = React.useState(false);
+
+ React.useEffect(() => {
+ const timer = setTimeout(() => setValue(true), delayMsec);
+ return () => clearTimeout(timer);
+ }, [delayMsec]);
+
+ return value;
+};
diff --git a/js_modules/dagster-ui/packages/ui-components/src/index.ts b/js_modules/dagster-ui/packages/ui-components/src/index.ts
index 4c209b68e80ca..cca86333fa3a5 100644
--- a/js_modules/dagster-ui/packages/ui-components/src/index.ts
+++ b/js_modules/dagster-ui/packages/ui-components/src/index.ts
@@ -51,6 +51,7 @@ export * from './components/useSuggestionsForString';
export * from './components/ErrorBoundary';
export * from './components/useViewport';
export * from './components/StyledRawCodeMirror';
+export * from './components/useDelayedState';
// Global font styles, exported as styled-component components to render in
// your app tree root. E.g.