forked from reactstrap/reactstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayoutPage.js
More file actions
73 lines (71 loc) · 2.06 KB
/
Copy pathLayoutPage.js
File metadata and controls
73 lines (71 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
import React from 'react';
import { PrismCode } from 'react-prism';
import PageTitle from '../UI/PageTitle';
import SectionTitle from '../UI/SectionTitle';
import LayoutExample from '../examples/Layout';
const LayoutExampleSource = require('!!raw!../examples/Layout');
export default class LayoutsPage extends React.Component {
render() {
return (
<div>
<PageTitle title="Layout Components (Container, Row, Col)" />
<div className="docs-example">
<LayoutExample />
</div>
<pre>
<PrismCode className="language-jsx">
{LayoutExampleSource}
</PrismCode>
</pre>
<h4>Container Properties</h4>
<pre>
<PrismCode className="language-jsx">
{`Container.propTypes = {
fluid: PropTypes.bool
// applies .container-fluid class
}`}
</PrismCode>
</pre>
<h4>Row Properties</h4>
<pre>
<PrismCode className="language-jsx">
{`Row.propTypes = {
noGutters: PropTypes.bool
}`}
</PrismCode>
</pre>
<h4>Col Properties</h4>
<pre>
<PrismCode className="language-jsx">
{`const stringOrNumberProp = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);
const columnProps = PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
PropTypes.shape({
size: PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.string]),
// example size values:
// 12 || "12" => col-12 or col-\`width\`-12
// auto => col-auto or col-\`width\`-auto
// true => col or col-\`width\`
order: stringOrNumberProp,
offset: stringOrNumberProp
})
]);
Col.propTypes = {
xs: columnProps,
sm: columnProps,
md: columnProps,
lg: columnProps,
xl: columnProps,
// override the predefined width (the ones above) with your own custom widths.
// see https://github.com/reactstrap/reactstrap/issues/297#issuecomment-273556116
widths: PropTypes.array,
}`}
</PrismCode>
</pre>
</div>
);
}
}