Skip to content

Commit 2497498

Browse files
committed
Add documentation for the styleguide.
1 parent ff783cb commit 2497498

File tree

2 files changed

+89
-3
lines changed

2 files changed

+89
-3
lines changed

src/FullscreenDialog.js

+40-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function FullscreenDialog (props, { muiTheme }) {
5858
style={{ ...styles.appBar, ...appBarStyle }}
5959
iconElementLeft={(
6060
<IconButton onClick={onRequestClose}>
61-
{closeIcon || <NavigationCloseIcon />}
61+
{closeIcon}
6262
</IconButton>
6363
)}
6464
iconElementRight={actionButton}
@@ -73,23 +73,60 @@ export default function FullscreenDialog (props, { muiTheme }) {
7373
}
7474

7575
FullscreenDialog.propTypes = {
76+
/**
77+
* A `FlatButton` or `IconButton` that is used as affirmative action button.
78+
*/
7679
actionButton: PropTypes.node,
80+
/**
81+
* Overrides the inline-styles of the app bar.
82+
*/
7783
appBarStyle: PropTypes.object,
84+
/**
85+
* Overrides the z-depth of the app bar, will affect its shadow. This is ignored if immersive is set to `true`.
86+
*/
7887
appBarZDepth: PropTypes.oneOf([0, 1, 2, 3, 4, 5]),
88+
/**
89+
* Children elements.
90+
*/
7991
children: PropTypes.node,
92+
/**
93+
* Icon element used for the dismissive action. This is hidden if `onRequestClose` is not set.
94+
*/
8095
closeIcon: PropTypes.node,
96+
/**
97+
* Overrides the inline-styles of the dialog's children container.
98+
*/
8199
containerStyle: PropTypes.object,
100+
/**
101+
* Toggles the immersive mode. If set to `true`, the app bar has a semi-transparent gradient and overlays the content.
102+
*/
82103
immersive: PropTypes.bool,
104+
/**
105+
* Callback that is invoked when the dismissive action button is touched.
106+
*/
83107
onRequestClose: PropTypes.func,
108+
/**
109+
* Controls whether the dialog is opened or not.
110+
*/
84111
open: PropTypes.bool.isRequired,
112+
/**
113+
* Overrides the inline-styles of the dialog's root element.
114+
*/
85115
style: PropTypes.object,
116+
/**
117+
* The title of the dialog.
118+
*/
86119
title: PropTypes.string,
120+
/**
121+
* Overrides the inline-styles of the app bar's title element.
122+
*/
87123
titleStyle: PropTypes.object
88124
}
89125

90126
FullscreenDialog.defaultProps = {
91-
immersive: false,
92-
appBarZDepth: 1
127+
appBarZDepth: 1,
128+
closeIcon: <NavigationCloseIcon />,
129+
immersive: false
93130
}
94131

95132
FullscreenDialog.contextTypes = {

src/FullscreenDialog.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
This is a fullscreen dialog with a button on the right.
2+
3+
```
4+
const RaisedButton = require('material-ui/RaisedButton').default;
5+
const FlatButton = require('material-ui/FlatButton').default;
6+
7+
<div>
8+
<FullscreenDialog
9+
open={state.open}
10+
onRequestClose={(...args) => {
11+
setState({ open: false })
12+
}}
13+
title='Demo dialog'
14+
actionButton={<FlatButton
15+
label='Done'
16+
onClick={() => setState({ open: false })}
17+
/>}
18+
/>
19+
20+
<RaisedButton
21+
onClick={() => setState({ open: true })}
22+
label='Open dialog'
23+
/>
24+
</div>
25+
```
26+
27+
The fullscreen dialog also supports an _immersive mode_ that makes the app bar transparent.
28+
29+
```
30+
const RaisedButton = require('material-ui/RaisedButton').default;
31+
32+
<div>
33+
<FullscreenDialog
34+
open={state.open}
35+
onRequestClose={(...args) => {
36+
setState({ open: false })
37+
}}
38+
title='Picture of a cat'
39+
immersive
40+
>
41+
<div style={{ width: '100%', height: '100%', background: 'url(https://lorempixel.com/1920/1080/cats/)', backgroundSize: 'cover' }} />
42+
</FullscreenDialog>
43+
44+
<RaisedButton
45+
onClick={() => setState({ open: true })}
46+
label='Show cat'
47+
/>
48+
</div>
49+
```

0 commit comments

Comments
 (0)