"
+}
diff --git a/docs/pages/base/api/use-snackbar.js b/docs/pages/base/api/use-snackbar.js
new file mode 100644
index 00000000000000..38b6b38c1bb46c
--- /dev/null
+++ b/docs/pages/base/api/use-snackbar.js
@@ -0,0 +1,23 @@
+import * as React from 'react';
+import HookApiPage from 'docs/src/modules/components/HookApiPage';
+import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
+import jsonPageContent from './use-snackbar.json';
+
+export default function Page(props) {
+ const { descriptions, pageContent } = props;
+ return ;
+}
+
+Page.getInitialProps = () => {
+ const req = require.context(
+ 'docs/translations/api-docs/use-snackbar',
+ false,
+ /use-snackbar.*.json$/,
+ );
+ const descriptions = mapApiPageTranslations(req);
+
+ return {
+ descriptions,
+ pageContent: jsonPageContent,
+ };
+};
diff --git a/docs/pages/base/api/use-snackbar.json b/docs/pages/base/api/use-snackbar.json
new file mode 100644
index 00000000000000..f4681170d07369
--- /dev/null
+++ b/docs/pages/base/api/use-snackbar.json
@@ -0,0 +1,36 @@
+{
+ "parameters": {
+ "autoHideDuration": {
+ "type": {
+ "name": "number | null",
+ "description": "The number of milliseconds to wait before automatically calling the\n`onClose` function. `onClose` should then set the state of the `open`\nprop to hide the Snackbar. This behavior is disabled by default with\nthe `null` value."
+ },
+ "default": "null"
+ },
+ "disableWindowBlurListener": {
+ "type": {
+ "name": "boolean",
+ "description": "If `true`, the `autoHideDuration` timer will expire even if the window is not focused."
+ },
+ "default": "false"
+ },
+ "onClose": {
+ "type": {
+ "name": "(event: React.SyntheticEvent | Event | null, reason: SnackbarCloseReason) => void",
+ "description": "Callback fired when the component requests to be closed.\nTypically `onClose` is used to set state in the parent component,\nwhich is used to control the `Snackbar` `open` prop.\nThe `reason` parameter can optionally be used to control the response to `onClose`,\nfor example ignoring `clickaway`."
+ }
+ },
+ "open": { "type": { "name": "boolean", "description": "If `true`, the component is shown." } },
+ "ref": { "type": { "name": "React.Ref", "description": "" } },
+ "resumeHideDuration": {
+ "type": {
+ "name": "number",
+ "description": "The number of milliseconds to wait before dismissing after user interaction.\nIf `autoHideDuration` prop isn't specified, it does nothing.\nIf `autoHideDuration` prop is specified but `resumeHideDuration` isn't,\nwe default to `autoHideDuration / 2` ms."
+ }
+ }
+ },
+ "returnValue": {},
+ "name": "useSnackbar",
+ "filename": "/packages/mui-base/src/SnackbarUnstyled/useSnackbar.ts",
+ "demos": "
+
+ );
+}
+
+PropertiesTable.propTypes = {
+ properties: PropTypes.object.isRequired,
+ propertiesDescriptions: PropTypes.object.isRequired,
+ showOptionalAbbr: PropTypes.bool,
+};
diff --git a/docs/src/modules/utils/helpers.ts b/docs/src/modules/utils/helpers.ts
index 8139f09f08a3cd..c9c6c8d282011e 100644
--- a/docs/src/modules/utils/helpers.ts
+++ b/docs/src/modules/utils/helpers.ts
@@ -35,7 +35,7 @@ export function pageToTitle(page: Page): string | null {
// TODO support more than React component API (PascalCase)
if (path.indexOf('/api/') !== -1) {
- return pascalCase(name);
+ return name.startsWith('use') ? camelCase(name) : pascalCase(name);
}
return titleize(name);
diff --git a/docs/translations/api-docs/use-autocomplete/use-autocomplete.json b/docs/translations/api-docs/use-autocomplete/use-autocomplete.json
new file mode 100644
index 00000000000000..365b442d731342
--- /dev/null
+++ b/docs/translations/api-docs/use-autocomplete/use-autocomplete.json
@@ -0,0 +1,42 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": {
+ "autoComplete": "If true, the portion of the selected suggestion that has not been typed by the user,\nknown as the completion string, appears inline after the input cursor in the textbox.\nThe inline completion string is visually highlighted and has a selected state.",
+ "autoHighlight": "If true, the first option is automatically highlighted.",
+ "autoSelect": "If true, the selected option becomes the value of the input\nwhen the Autocomplete loses focus unless the user chooses\na different option or changes the character string in the input.",
+ "blurOnSelect": "Control if the input should be blurred when an option is selected:\n\n- false the input is not blurred.\n- true the input is always blurred.\n- touch the input is blurred after a touch event.\n- mouse the input is blurred after a mouse event.",
+ "clearOnBlur": "If true, the input's text is cleared on blur if no value is selected.\n\nSet to true if you want to help the user enter a new value.\nSet to false if you want to help the user resume their search.",
+ "clearOnEscape": "If true, clear all values when the user presses escape and the popup is closed.",
+ "componentName": "The component name that is using this hook. Used for warnings.",
+ "defaultValue": "The default value. Use when the component is not controlled.",
+ "disableClearable": "If true, the input can't be cleared.",
+ "disableCloseOnSelect": "If true, the popup won't close when a value is selected.",
+ "disabled": "If true, the component is disabled.",
+ "disabledItemsFocusable": "If true, will allow focus on disabled items.",
+ "disableListWrap": "If true, the list box in the popup will not wrap focus.",
+ "filterOptions": "A function that determines the filtered options to be rendered on search.",
+ "filterSelectedOptions": "If true, hide the selected options from the list box.",
+ "freeSolo": "If true, the Autocomplete is free solo, meaning that the user input is not bound to provided options.",
+ "getOptionDisabled": "Used to determine the disabled state for a given option.",
+ "getOptionLabel": "Used to determine the string value for a given option.\nIt's used to fill the input (and the list box options if renderOption is not provided).\n\nIf used in free solo mode, it must accept both the type of the options and a string.",
+ "groupBy": "If provided, the options will be grouped under the returned string.\nThe groupBy value is also used as the text for group headings when renderGroup is not provided.",
+ "handleHomeEndKeys": "If true, the component handles the \"Home\" and \"End\" keys when the popup is open.\nIt should move focus to the first option and last option, respectively.",
+ "id": "This prop is used to help implement the accessibility logic.\nIf you don't provide an id it will fall back to a randomly generated one.",
+ "includeInputInList": "If true, the highlight can move to the input.",
+ "inputValue": "The input value.",
+ "isOptionEqualToValue": "Used to determine if the option represents the given value.\nUses strict equality by default.\n⚠️ Both arguments need to be handled, an option can only match with one value.",
+ "multiple": "If true, value must be an array and the menu will support multiple selections.",
+ "onChange": "Callback fired when the value changes.",
+ "onClose": "Callback fired when the popup requests to be closed.\nUse in controlled mode (see open).",
+ "onHighlightChange": "Callback fired when the highlight option changes.",
+ "onInputChange": "Callback fired when the input value changes.",
+ "onOpen": "Callback fired when the popup requests to be opened.\nUse in controlled mode (see open).",
+ "open": "If true, the component is shown.",
+ "openOnFocus": "If true, the popup will open on input focus.",
+ "options": "Array of options.",
+ "readOnly": "If true, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.",
+ "selectOnFocus": "If true, the input's text is selected on focus.\nIt helps the user clear the selected value.",
+ "value": "The value of the autocomplete.\n\nThe value must have reference equality with the option in order to be selected.\nYou can customize the equality behavior with the isOptionEqualToValue prop."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-badge/use-badge.json b/docs/translations/api-docs/use-badge/use-badge.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-badge/use-badge.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-button/use-button.json b/docs/translations/api-docs/use-button/use-button.json
new file mode 100644
index 00000000000000..a1fefeab7fc5a6
--- /dev/null
+++ b/docs/translations/api-docs/use-button/use-button.json
@@ -0,0 +1,15 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": {
+ "disabled": "If true, the component is disabled.",
+ "focusableWhenDisabled": "If true, allows a disabled button to receive focus.",
+ "type": "Type attribute applied when the component is button."
+ },
+ "returnValueDescriptions": {
+ "active": "If true, the component is active (pressed).",
+ "disabled": "If true, the component is disabled.",
+ "focusVisible": "If true, the component is being focused using keyboard.",
+ "getRootProps": "Resolver for the root slot's props.",
+ "setFocusVisible": "Callback for setting the focusVisible param."
+ }
+}
diff --git a/docs/translations/api-docs/use-form-control-unstyled-context/use-form-control-unstyled-context.json b/docs/translations/api-docs/use-form-control-unstyled-context/use-form-control-unstyled-context.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-form-control-unstyled-context/use-form-control-unstyled-context.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-input/use-input.json b/docs/translations/api-docs/use-input/use-input.json
new file mode 100644
index 00000000000000..73535952943abe
--- /dev/null
+++ b/docs/translations/api-docs/use-input/use-input.json
@@ -0,0 +1,10 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": {
+ "defaultValue": "The default value. Use when the component is not controlled.",
+ "disabled": "If true, the component is disabled.\nThe prop defaults to the value (false) inherited from the parent FormControl component.",
+ "error": "If true, the input will indicate an error by setting the aria-invalid attribute.\nThe prop defaults to the value (false) inherited from the parent FormControl component.",
+ "required": "If true, the input element is required.\nThe prop defaults to the value (false) inherited from the parent FormControl component."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-menu-item/use-menu-item.json b/docs/translations/api-docs/use-menu-item/use-menu-item.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-menu-item/use-menu-item.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-menu/use-menu.json b/docs/translations/api-docs/use-menu/use-menu.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-menu/use-menu.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-select/use-select.json b/docs/translations/api-docs/use-select/use-select.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-select/use-select.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-slider/use-slider.json b/docs/translations/api-docs/use-slider/use-slider.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-slider/use-slider.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-snackbar/use-snackbar.json b/docs/translations/api-docs/use-snackbar/use-snackbar.json
new file mode 100644
index 00000000000000..9e7fa070b5372d
--- /dev/null
+++ b/docs/translations/api-docs/use-snackbar/use-snackbar.json
@@ -0,0 +1,11 @@
+{
+ "hookDescription": "The basic building block for creating custom snackbar.",
+ "parametersDescriptions": {
+ "autoHideDuration": "The number of milliseconds to wait before automatically calling the\nonClose function. onClose should then set the state of the open\nprop to hide the Snackbar. This behavior is disabled by default with\nthe null value.",
+ "disableWindowBlurListener": "If true, the autoHideDuration timer will expire even if the window is not focused.",
+ "onClose": "Callback fired when the component requests to be closed.\nTypically onClose is used to set state in the parent component,\nwhich is used to control the Snackbaropen prop.\nThe reason parameter can optionally be used to control the response to onClose,\nfor example ignoring clickaway.",
+ "open": "If true, the component is shown.",
+ "resumeHideDuration": "The number of milliseconds to wait before dismissing after user interaction.\nIf autoHideDuration prop isn't specified, it does nothing.\nIf autoHideDuration prop is specified but resumeHideDuration isn't,\nwe default to autoHideDuration / 2 ms."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-switch/use-switch.json b/docs/translations/api-docs/use-switch/use-switch.json
new file mode 100644
index 00000000000000..d86c01fefbf08d
--- /dev/null
+++ b/docs/translations/api-docs/use-switch/use-switch.json
@@ -0,0 +1,12 @@
+{
+ "hookDescription": "The basic building block for creating custom switches.",
+ "parametersDescriptions": {
+ "checked": "If true, the component is checked.",
+ "defaultChecked": "The default checked state. Use when the component is not controlled.",
+ "disabled": "If true, the component is disabled.",
+ "onChange": "Callback fired when the state is changed.",
+ "readOnly": "If true, the component is read only.",
+ "required": "If true, the input element is required."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-tab-panel/use-tab-panel.json b/docs/translations/api-docs/use-tab-panel/use-tab-panel.json
new file mode 100644
index 00000000000000..e3eb65c6e43006
--- /dev/null
+++ b/docs/translations/api-docs/use-tab-panel/use-tab-panel.json
@@ -0,0 +1 @@
+{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
diff --git a/docs/translations/api-docs/use-tab/use-tab.json b/docs/translations/api-docs/use-tab/use-tab.json
new file mode 100644
index 00000000000000..ad187ec0174b4d
--- /dev/null
+++ b/docs/translations/api-docs/use-tab/use-tab.json
@@ -0,0 +1,8 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": {
+ "onChange": "Callback invoked when new value is being set.",
+ "value": "You can provide your own value. Otherwise, we fall back to the child position index."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-tabs-list/use-tabs-list.json b/docs/translations/api-docs/use-tabs-list/use-tabs-list.json
new file mode 100644
index 00000000000000..db744fcd075302
--- /dev/null
+++ b/docs/translations/api-docs/use-tabs-list/use-tabs-list.json
@@ -0,0 +1,5 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": { "children": "The content of the component." },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/api-docs/use-tabs/use-tabs.json b/docs/translations/api-docs/use-tabs/use-tabs.json
new file mode 100644
index 00000000000000..6c6ac26d60e1dd
--- /dev/null
+++ b/docs/translations/api-docs/use-tabs/use-tabs.json
@@ -0,0 +1,12 @@
+{
+ "hookDescription": "",
+ "parametersDescriptions": {
+ "defaultValue": "The default value. Use when the component is not controlled.",
+ "direction": "The direction of the text.",
+ "onChange": "Callback invoked when new value is being set.",
+ "orientation": "The component orientation (layout flow direction).",
+ "selectionFollowsFocus": "If true the selected tab changes on focus. Otherwise it only\nchanges on activation.",
+ "value": "The value of the currently selected Tab.\nIf you don't want any selected Tab, you can set this prop to false."
+ },
+ "returnValueDescriptions": {}
+}
diff --git a/docs/translations/translations.json b/docs/translations/translations.json
index 105963b93ad5ee..bcde93ca7c1e2b 100644
--- a/docs/translations/translations.json
+++ b/docs/translations/translations.json
@@ -2,12 +2,14 @@
"adblock": "If you don't mind tech-related ads (no tracking or remarketing), and want to keep us running, please whitelist MUI in your blocker.",
"api-docs": {
"componentName": "Component name",
+ "hookName": "Hook name",
"cssComponent": "As a CSS utility, the {{name}} component also supports all system properties. You can use them as props directly on the component.",
"default": "Default",
"demos": "Demos",
"deprecated": "Deprecated",
"description": "Description",
"globalClass": "Global class",
+ "hooksPageDescription": "API reference docs for the {{name}} hook. Learn about the input parameters and other APIs of this exported module.",
"import": "Import",
"importDifference": "You can learn about the difference by reading this guide on minimizing bundle size.",
"inheritance": "Inheritance",
@@ -19,6 +21,8 @@
"overrideStylesStyledComponent": "