{fabs?.map(fb => {
+ const FabComponent = fb.Component;
+
return (
-
+ {FabComponent ? (
+
+ ) : (
+
+ )}
);
diff --git a/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/components/FloatingButton.tsx b/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/components/FloatingButton.tsx
index 0a85787cd1..cce699d149 100644
--- a/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/components/FloatingButton.tsx
+++ b/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/components/FloatingButton.tsx
@@ -89,6 +89,10 @@ export const FloatingButton = ({
);
} else {
+ const singleFab = fabs[0];
+ const FabComponent = singleFab.Component;
+
+ // If a custom FAB component is provided, render it instead of CustomFab
fabDiv = (
-
+ {FabComponent ? (
+
+ ) : (
+
+ )}
);
}
diff --git a/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/types.ts b/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/types.ts
index 00d342dd5e..6ce64154d6 100644
--- a/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/types.ts
+++ b/workspaces/global-floating-action-button/plugins/global-floating-action-button/src/types.ts
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+import { ComponentType } from 'react';
+
/**
* Slot
*
@@ -56,9 +58,26 @@ export type FloatingActionButton = {
to?: string;
toolTip?: string;
toolTipKey?: string;
+ /**
+ * Priority for ordering buttons (lower number = higher priority)
+ * The FAB action with the lowest priority will be displayed on top of other FAB actions in the sub-menu
+ */
priority?: number;
visibleOnPaths?: string[];
excludeOnPaths?: string[];
+ /**
+ * Whether the FAB is disabled
+ */
+ isDisabled?: boolean;
+ /**
+ * Tooltip to display when the FAB is disabled
+ */
+ disabledToolTip?: string;
+ disabledToolTipKey?: string;
+ /**
+ * Custom FAB component
+ */
+ Component?: ComponentType;
};
/**