@@ -12,14 +12,13 @@ import {
1212 ExtendedTemplateConfig ,
1313 AnalyticsTracker ,
1414 WidgetConfiguration ,
15+ Breakpoints ,
1516} from './types' ;
1617import { Button , EmptyState , EmptyStateActions , EmptyStateBody , EmptyStateVariant , PageSection } from '@patternfly/react-core' ;
1718import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon' ;
1819import GripVerticalIcon from '@patternfly/react-icons/dist/esm/icons/grip-vertical-icon' ;
1920import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon' ;
20- import { columns , breakpoints , droppingElemId , getWidgetIdentifier , extendLayout , getGridDimensions } from './utils' ;
21-
22- export const defaultBreakpoints = breakpoints ;
21+ import { defaultBreakpoints , defaultColumns , droppingElemId , getWidgetIdentifier , extendLayout , getGridDimensions } from './utils' ;
2322
2423const createSerializableConfig = ( config ?: WidgetConfiguration ) => {
2524 if ( ! config ) { return undefined ; }
@@ -62,6 +61,10 @@ export interface GridLayoutProps {
6261 droppingWidgetType ?: string ;
6362 /** Resize configuration options */
6463 resizeWidgetConfig ?: Partial < ResizeConfig > ;
64+ /** Custom breakpoints for responsive layout (container width thresholds in px) */
65+ breakpoints ?: Breakpoints ;
66+ /** Custom column counts per breakpoint variant */
67+ columns ?: Record < Variants , number > ;
6568}
6669
6770const LayoutEmptyState = ( {
@@ -107,6 +110,8 @@ const GridLayout = ({
107110 onActiveWidgetsChange,
108111 droppingWidgetType,
109112 resizeWidgetConfig,
113+ breakpoints = defaultBreakpoints ,
114+ columns = defaultColumns ,
110115} : GridLayoutProps ) => {
111116 const [ isDragging , setIsDragging ] = useState ( false ) ;
112117 const [ isInitialRender , setIsInitialRender ] = useState ( true ) ;
@@ -226,10 +231,10 @@ const GridLayout = ({
226231 // Update layout variant when container width changes
227232 useEffect ( ( ) => {
228233 if ( mounted && layoutWidth > 0 ) {
229- const variant : Variants = getGridDimensions ( layoutWidth ) ;
234+ const variant : Variants = getGridDimensions ( layoutWidth , breakpoints ) ;
230235 setLayoutVariant ( variant ) ;
231236 }
232- } , [ layoutWidth , mounted ] ) ;
237+ } , [ layoutWidth , mounted , breakpoints ] ) ;
233238
234239 const activeLayout = internalTemplate [ layoutVariant ] || [ ] ;
235240
0 commit comments