Skip to content

[grid] Remove 'column' and 'column-reverse' directions#48117

Closed
silviuaavram wants to merge 1 commit into
mui:masterfrom
silviuaavram:docs/remove-wrong-grid-direction
Closed

[grid] Remove 'column' and 'column-reverse' directions#48117
silviuaavram wants to merge 1 commit into
mui:masterfrom
silviuaavram:docs/remove-wrong-grid-direction

Conversation

@silviuaavram
Copy link
Copy Markdown
Member

@silviuaavram silviuaavram commented Mar 27, 2026

Fixes #47563.

We should remove the 'column' and 'column-reverse' from the Grid docs.

Copilot AI review requested due to automatic review settings March 27, 2026 14:37
@silviuaavram silviuaavram added docs Improvements or additions to the documentation. component: Grid The React component. v7.x needs cherry-pick The PR should be cherry-picked to master after merge. labels Mar 27, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 27, 2026

Netlify deploy preview

https://deploy-preview-48117--material-ui.netlify.app/

Bundle size report

Bundle size will be reported once CircleCI build #912072 finishes.

Generated by 🚫 dangerJS against 4dd2224

@ZeeshanTamboli
Copy link
Copy Markdown
Member

It was already being worked on in #47564, maybe we should close that one.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Grid API surface and documentation to reflect that direction only supports horizontal layouts (row / row-reverse), addressing the mismatch called out in #47563.

Changes:

  • Removed column / column-reverse from GridDirection TypeScript types across System, Material Grid, and PigmentGrid.
  • Narrowed direction PropTypes and utility-class direction lists to match the supported values.
  • Updated the Material Grid API docs JSON to no longer list the removed direction values.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/mui-system/src/Grid/gridClasses.ts Removes column direction entries from the generated direction class slots.
packages/mui-system/src/Grid/createGrid.tsx Narrows direction PropTypes to row/row-reverse.
packages/mui-system/src/Grid/GridProps.ts Narrows the public GridDirection type.
packages/mui-system/src/Grid/Grid.tsx Narrows direction PropTypes to row/row-reverse.
packages/mui-material/src/PigmentGrid/PigmentGrid.tsx Narrows PigmentGrid GridDirection and direction PropTypes.
packages/mui-material/src/Grid/gridClasses.ts Removes column direction entries from the generated direction class slots.
packages/mui-material/src/Grid/Grid.tsx Narrows Material Grid GridDirection and direction PropTypes.
docs/pages/material-ui/api/grid.json Updates Material Grid API docs for the narrowed direction union.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 27 to 30
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as const;
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'] as const;
const DIRECTIONS = ['row-reverse', 'row'] as const;
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'] as const;
const GRID_SIZES = ['auto', 'grow', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const;
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After narrowing DIRECTIONS to only row/row-reverse, GridClasses still requires direction-xs-column and direction-xs-column-reverse keys. Since generateUtilityClasses() now won't generate those slots, const gridClasses: GridClasses = ... becomes type-incompatible (missing required properties) and should fail TypeScript. Update GridClasses to remove the column-related keys (and adjust the related JSDoc) so the interface matches the generated slots.

Copilot uses AI. Check for mistakes.
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };

export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
export type GridDirection = 'row' | 'row-reverse';
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes column / column-reverse from the public GridDirection type, but related generated docs/tests still reference those values (e.g. docs/pages/system/api/grid.json and gridGenerator.test.js still include column). Please regenerate/update the System Grid API docs and align/remove the column-related test expectations so the repository doesn’t keep documenting/testing unsupported directions.

Suggested change
export type GridDirection = 'row' | 'row-reverse';
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 22
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };

export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
export type GridDirection = 'row' | 'row-reverse';

export type GridSpacing = number | string;
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GridDirection and the direction PropTypes were narrowed to row/row-reverse, but the generated PigmentGrid API docs still list column/column-reverse (see docs/pages/material-ui/api/pigment-grid.json). Please regenerate/update the PigmentGrid API JSON so the docs reflect the new supported values.

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 22
"type": {
"name": "union",
"description": "'column-reverse'<br>&#124;&nbsp;'column'<br>&#124;&nbsp;'row-reverse'<br>&#124;&nbsp;'row'<br>&#124;&nbsp;Array&lt;'column-reverse'<br>&#124;&nbsp;'column'<br>&#124;&nbsp;'row-reverse'<br>&#124;&nbsp;'row'&gt;<br>&#124;&nbsp;object"
"description": "'row-reverse'<br>&#124;&nbsp;'row'<br>&#124;&nbsp;Array&lt;'row-reverse'<br>&#124;&nbsp;'row'&gt;<br>&#124;&nbsp;object"
},
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Material Grid API JSON is updated here, but the translated API docs still describe the removed direction class keys/values (e.g. docs/translations/api-docs/grid/grid.json still mentions direction-xs-column*). Please regenerate/update the translation/API-doc artifacts to avoid inconsistent documentation across locales.

Copilot uses AI. Check for mistakes.
@siriwatknp
Copy link
Copy Markdown
Member

Hasn't @sai6855 already did this?

@ZeeshanTamboli
Copy link
Copy Markdown
Member

Hasn't @sai6855 already did this?

Nope, see #48117 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Grid The React component. docs Improvements or additions to the documentation. needs cherry-pick The PR should be cherry-picked to master after merge. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs][grid] Incorrect direction prop description

7 participants