Skip to content

Commit f1a709d

Browse files
[docs][appbar] Document correct default values for elevation and square props (#47261)
Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
1 parent dba6024 commit f1a709d

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

docs/pages/material-ui/api/app-bar.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"default": "'primary'"
1111
},
12+
"elevation": { "type": { "name": "number" }, "default": "4" },
1213
"enableColorOnDark": { "type": { "name": "bool" }, "default": "false" },
1314
"position": {
1415
"type": {
@@ -17,6 +18,7 @@
1718
},
1819
"default": "'fixed'"
1920
},
21+
"square": { "type": { "name": "bool" }, "default": "true" },
2022
"sx": {
2123
"type": {
2224
"name": "union",

docs/translations/api-docs/app-bar/app-bar.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
"color": {
77
"description": "The color of the component. It supports both default and custom theme colors, which can be added as shown in the <a href=\"https://mui.com/material-ui/customization/palette/#custom-colors\">palette customization guide</a>."
88
},
9+
"elevation": {
10+
"description": "Shadow depth, corresponds to <code>dp</code> in the spec. It accepts values between 0 and 24 inclusive."
11+
},
912
"enableColorOnDark": {
1013
"description": "If true, the <code>color</code> prop is applied in dark mode."
1114
},
1215
"position": {
1316
"description": "The positioning type. The behavior of the different options is described <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position\">in the MDN web docs</a>. Note: <code>sticky</code> is not universally supported and will fall back to <code>static</code> when unavailable."
1417
},
18+
"square": { "description": "If <code>false</code>, rounded corners are enabled." },
1519
"sx": {
1620
"description": "The system prop that allows defining system overrides as well as additional CSS styles."
1721
}

packages/mui-material/src/AppBar/AppBar.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export interface AppBarOwnProps {
2323
PropTypes.Color | 'transparent' | 'error' | 'info' | 'success' | 'warning',
2424
AppBarPropsColorOverrides
2525
>;
26+
/**
27+
* Shadow depth, corresponds to `dp` in the spec.
28+
* It accepts values between 0 and 24 inclusive.
29+
* @default 4
30+
*/
31+
elevation?: number;
2632
/**
2733
* If true, the `color` prop is applied in dark mode.
2834
* @default false
@@ -35,6 +41,11 @@ export interface AppBarOwnProps {
3541
* @default 'fixed'
3642
*/
3743
position?: 'fixed' | 'absolute' | 'sticky' | 'static' | 'relative';
44+
/**
45+
* If `false`, rounded corners are enabled.
46+
* @default true
47+
*/
48+
square?: boolean;
3849
/**
3950
* The system prop that allows defining system overrides as well as additional CSS styles.
4051
*/
@@ -49,7 +60,7 @@ export type AppBarTypeMap<
4960
props: AdditionalProps & AppBarOwnProps;
5061
defaultComponent: RootComponent;
5162
},
52-
'position' | 'color' | 'classes'
63+
'position' | 'color' | 'classes' | 'elevation' | 'square'
5364
>;
5465

5566
/**

packages/mui-material/src/AppBar/AppBar.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ AppBar.propTypes /* remove-proptypes */ = {
240240
]),
241241
PropTypes.string,
242242
]),
243+
/**
244+
* Shadow depth, corresponds to `dp` in the spec.
245+
* It accepts values between 0 and 24 inclusive.
246+
* @default 4
247+
*/
248+
elevation: PropTypes.number,
243249
/**
244250
* If true, the `color` prop is applied in dark mode.
245251
* @default false
@@ -252,6 +258,11 @@ AppBar.propTypes /* remove-proptypes */ = {
252258
* @default 'fixed'
253259
*/
254260
position: PropTypes.oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']),
261+
/**
262+
* If `false`, rounded corners are enabled.
263+
* @default true
264+
*/
265+
square: PropTypes.bool,
255266
/**
256267
* The system prop that allows defining system overrides as well as additional CSS styles.
257268
*/

0 commit comments

Comments
 (0)