-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
947ad7d
commit 8d8e710
Showing
10 changed files
with
178 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
docs/src/app/components/pages/components/IconButton/ExampleMaterial.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import FontIcon from 'material-ui/lib/font-icon'; | ||
import IconButton from 'material-ui/lib/icon-button'; | ||
|
||
const IconButtonExampleMaterial = () => ( | ||
<div> | ||
<IconButton tooltip="Sort" disabled={true}> | ||
<FontIcon className="muidocs-icon-custom-sort"/> | ||
</IconButton> | ||
<IconButton | ||
iconClassName="material-icons" | ||
tooltip="Sky"> | ||
settings_system_daydream | ||
</IconButton> | ||
</div> | ||
); | ||
|
||
export default IconButtonExampleMaterial; |
8 changes: 8 additions & 0 deletions
8
docs/src/app/components/pages/components/IconButton/ExampleSimple.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import IconButton from 'material-ui/lib/icon-button'; | ||
|
||
const IconButtonExampleSimple = () => ( | ||
<IconButton iconClassName="muidocs-icon-custom-github" /> | ||
); | ||
|
||
export default IconButtonExampleSimple; |
21 changes: 21 additions & 0 deletions
21
docs/src/app/components/pages/components/IconButton/ExampleTooltip.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import IconButton from 'material-ui/lib/icon-button'; | ||
|
||
const IconButtonExampleTooltip = () => ( | ||
<div> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right" | ||
tooltipPosition="bottom-right" /> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-center" | ||
tooltipPosition="bottom-center" /> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-left" | ||
tooltipPosition="bottom-left" /> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-right" | ||
tooltipPosition="top-right" /> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-center" | ||
tooltipPosition="top-center" /> | ||
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-left" | ||
tooltipPosition="top-left" /> | ||
</div> | ||
); | ||
|
||
export default IconButtonExampleTooltip; |
28 changes: 28 additions & 0 deletions
28
docs/src/app/components/pages/components/IconButton/ExampleTouch.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import IconButton from 'material-ui/lib/icon-button'; | ||
import ActionGrade from 'material-ui/lib/svg-icons/action/grade'; | ||
|
||
const IconButtonExampleTouch = () => ( | ||
<div> | ||
<IconButton tooltip="bottom-right" touch={true} tooltipPosition="bottom-right"> | ||
<ActionGrade/> | ||
</IconButton> | ||
<IconButton tooltip="bottom-center" touch={true} tooltipPosition="bottom-center"> | ||
<ActionGrade/> | ||
</IconButton> | ||
<IconButton tooltip="bottom-left" touch={true} tooltipPosition="bottom-left"> | ||
<ActionGrade/> | ||
</IconButton> | ||
<IconButton tooltip="top-right" touch={true} tooltipPosition="top-right"> | ||
<ActionGrade/> | ||
</IconButton> | ||
<IconButton tooltip="top-center" touch={true} tooltipPosition="top-center"> | ||
<ActionGrade/> | ||
</IconButton> | ||
<IconButton tooltip="top-left" touch={true} tooltipPosition="top-left"> | ||
<ActionGrade/> | ||
</IconButton> | ||
</div> | ||
); | ||
|
||
export default IconButtonExampleTouch; |
37 changes: 37 additions & 0 deletions
37
docs/src/app/components/pages/components/IconButton/Page.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import iconButtonCode from '!raw!material-ui/lib/icon-button'; | ||
import iconButtonReadmeText from './README'; | ||
import iconButtonExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import IconButtonExampleSimple from './ExampleSimple'; | ||
import iconButtonExampleTooltipCode from '!raw!./ExampleTooltip'; | ||
import IconButtonExampleTooltip from './ExampleTooltip'; | ||
import iconButtonExampleTouchCode from '!raw!./ExampleTouch'; | ||
import IconButtonExampleTouch from './ExampleTouch'; | ||
import iconButtonExampleMaterialCode from '!raw!./ExampleMaterial'; | ||
import IconButtonExampleMaterial from './ExampleMaterial'; | ||
|
||
|
||
const IconButtonPage = () => ( | ||
<div> | ||
<MarkdownElement text={iconButtonReadmeText} /> | ||
<CodeExample code={iconButtonExampleSimpleCode}> | ||
<IconButtonExampleSimple/> | ||
</CodeExample> | ||
<CodeExample code={iconButtonExampleTooltipCode}> | ||
<IconButtonExampleTooltip/> | ||
</CodeExample> | ||
<CodeExample code={iconButtonExampleTouchCode}> | ||
<IconButtonExampleTouch/> | ||
</CodeExample> | ||
<CodeExample code={iconButtonExampleMaterialCode}> | ||
<IconButtonExampleMaterial/> | ||
</CodeExample> | ||
<PropTypeDescription code={iconButtonCode} /> | ||
</div> | ||
); | ||
|
||
export default IconButtonPage; |
9 changes: 9 additions & 0 deletions
9
docs/src/app/components/pages/components/IconButton/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Icon Button | ||
An [Icon Button](https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons) generates a button element around an icon. Also, focus styles will happen on tab but not on click. There are three ways to add an icon: | ||
|
||
1. For stylesheets: Set the prop "iconClassName" to the classname for you icon. | ||
2. For SVG icons: Insert the SVG component as a child of icon buttons. This is the method we are using. [View our source](https://github.com/callemall/material-ui/blob/master/src/svg-icons/action/grade.jsx) to see how ActionGrade was created using mui.SvgIcon. | ||
3. Alternative: You can also insert a [FontIcon](http://www.material-ui.com/#/components/icons) component as a child of IconButton. This is similar to how the iconClassName prop from method 1 is handled. | ||
4. Google Material Icons: Now also supported for iconButtons by passing "material-icons" in iconClassName prop. | ||
|
||
### Examples |
191 changes: 0 additions & 191 deletions
191
docs/src/app/components/pages/components/icon-buttons.jsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.