Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add an example on how to use Tabs inside an AppBar #3005

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/src/app/components/pages/components/AppBar/ExampleTabs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import AppBar from 'material-ui/lib/app-bar';
import Tabs from 'material-ui/lib/tabs/tabs';
import Tab from 'material-ui/lib/tabs/tab';

const styles = {
appBar: {
flexWrap: 'wrap',
},
tabs: {
width: '100%',
},
};

const AppBarExampleTabs = () => (
<AppBar
title="Title"
style={styles.appBar}
iconClassNameRight="muidocs-icon-navigation-expand-more"
>
<Tabs style={styles.tabs}>
<Tab label="ALL" />
<Tab label="CAMERA" />
<Tab label="RECENT" />
</Tabs>
</AppBar>
);

export default AppBarExampleTabs;
10 changes: 10 additions & 0 deletions docs/src/app/components/pages/components/AppBar/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import AppBarExampleIconButton from './ExampleIconButton';
import appBarExampleIconButtonCode from '!raw!./ExampleIconButton';
import AppBarExampleIconMenu from './ExampleIconMenu';
import appBarExampleIconMenuCode from '!raw!./ExampleIconMenu';
import AppBarExampleTabs from './ExampleTabs';
import appBarExampleTabsCode from '!raw!./ExampleTabs';
import appBarCode from '!raw!material-ui/lib/app-bar';

const descriptions = {
icon: 'A simple example of `AppBar` with an icon on the right. ' +
'By default, the left icon is a navigation-menu.',
iconButton: '`IconButton` left, clickable title, and `FlatButton` right.',
iconMenu: '`IconMenu` on the right.',
tabs: 'Use `Tabs` to organize content at a high level.',
};

const AppBarPage = () => (
Expand All @@ -43,6 +46,13 @@ const AppBarPage = () => (
>
<AppBarExampleIconMenu />
</CodeExample>
<CodeExample
code={appBarExampleTabsCode}
title="Tabs"
description={descriptions.tabs}
>
<AppBarExampleTabs />
</CodeExample>
<PropTypeDescription code={appBarCode} />
</div>
);
Expand Down