Skip to content

Add size examples & documentation#1441

Open
FlyersPh9 wants to merge 16 commits intomainfrom
jon/size-demos-and-docs
Open

Add size examples & documentation#1441
FlyersPh9 wants to merge 16 commits intomainfrom
jon/size-demos-and-docs

Conversation

@FlyersPh9
Copy link
Copy Markdown
Collaborator

@FlyersPh9 FlyersPh9 commented Apr 22, 2026

Changes

Testing

  • Added to demo pages.

@FlyersPh9 FlyersPh9 self-assigned this Apr 22, 2026
Comment thread examples/mui/ButtonGroup.sizes.tsx
Comment thread examples/mui/Autocomplete.sizes.tsx
Comment thread examples/mui/Select.sizes.tsx Outdated
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Noticed that Select & NativeSelect are both documented within this page, so I didn't bother creating a NativeSelect.sizes.tsx.

@FlyersPh9 FlyersPh9 marked this pull request as ready for review April 23, 2026 17:04
@FlyersPh9 FlyersPh9 requested a review from a team as a code owner April 23, 2026 17:04
@FlyersPh9 FlyersPh9 requested review from GerardasB and mayank99 and removed request for a team April 23, 2026 17:04
import { visuallyHidden } from "@mui/utils";

export default () => {
const id = React.useId();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can't use the same id for both sliders.

Suggest splitting this into two components (defined below and used in the default export), each with their own id.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Like this? 6f22da4

Should I do the same for Select.sizes.tsx?

const smallId = React.useId();
const smallLabel = "Favorite small animal:";
const mediumId = React.useId();
const mediumLabel = "Favorite medium animal:";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, that seems good, although I would keep the export default () => above the other two components (I think of it as frontloading the "big picture" view).

Doing the same in Select.sizes.tsx makes sense.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved default up in 7b9b0a4.
Did the same for Select in 883b3c7.

Comment thread apps/website/src/content/docs/components/mui/Table.md Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't know Table supported size="small". We should validate the design and make any adjustments (e.g. row heights and paddings) in another PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I swear it used to be dense instead of size for table, but I may be misremembering.

Comment thread examples/mui/Autocomplete.sizes.tsx
];

return (
<TableContainer render={<Paper />}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we add a size picker to this example (that defaults to "small") as it is not feasible to display multiple sizes at once?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The default size is already shown elsewhere, so we could focus this on just the small size (and rename to Table.small.tsx).

Copy link
Copy Markdown
Collaborator

@GerardasB GerardasB Apr 24, 2026

Choose a reason for hiding this comment

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

Should the heading be renamed to ### Dense and only describe size="small"?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, that could work. At least the wording should be adjusted to mention that the example only shows the small size.

Copy link
Copy Markdown
Collaborator Author

@FlyersPh9 FlyersPh9 Apr 24, 2026

Choose a reason for hiding this comment

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

Renamed documentation header & code sample, updated documentation in 83ea425.

Comment thread examples/mui/Slider.sizes.tsx Outdated
Comment thread examples/mui/ButtonGroup.sizes.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants