material-ui: [ToggleButton] docs: missing "size" property in the API docs

Iโ€™m checking current API documentation for ToggleButton https://material-ui.com/api/toggle-button/, and I donโ€™t see the size prop being mentioned there. But, the size property does affect the size of the ToggleButton. (Iโ€™m using the ToggleButton as a standalone though, not within the ToggleButtonGroup.)

Exploring the code for 4.11.0 I see this: https://github.com/mui-org/material-ui/blob/v4.11.0/packages/material-ui-lab/src/ToggleButton/ToggleButton.js#L78 https://github.com/mui-org/material-ui/blob/v4.11.0/packages/material-ui-lab/src/ToggleButton/ToggleButton.js#L159-L162

And in the next branch this: image

Does this mean the property is intentionally missing from the API, as it is not intended to be used by the users, so that it is only used internally by the enclosing ToggleButtonGroup component?

  • [ X] The issue is present in the latest release.
  • [ X] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior ๐Ÿ˜ฏ

Expected Behavior ๐Ÿค”

Steps to Reproduce ๐Ÿ•น

Steps:

Context ๐Ÿ”ฆ

Your Environment ๐ŸŒŽ

Tech Version
Material-UI v4.11.0
React
Browser
TypeScript
etc.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (15 by maintainers)

Most upvoted comments

The prop defaults to the value injected by the parent ToggleButtonGroup component, via cloneElement.

Whe should remove mention of any implementation specifics. If this is important for the usage (interface) then describe that instead of concrete methods used.

@croraf The latest change was in #21687 with @eps1lon, however, the size prop was already ignored before that. In any case, I think that it was before we made a standalone ToggleButton a viable use case.