-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][docs] Add more content to the Material Icons page #40445
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; | ||
import AddAPhotoIcon from '@mui/icons-material/AddAPhoto'; | ||
|
||
export default function BasicMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap> | ||
<AcUnitIcon /> | ||
<AccountBalanceIcon /> | ||
<AddAPhotoIcon /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; | ||
import AddAPhotoIcon from '@mui/icons-material/AddAPhoto'; | ||
|
||
export default function BasicMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap> | ||
<AcUnitIcon /> | ||
<AccountBalanceIcon /> | ||
<AddAPhotoIcon /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<AcUnitIcon /> | ||
<AccountBalanceIcon /> | ||
<AddAPhotoIcon /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
|
||
export default function ColorMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap> | ||
<AcUnitIcon color="primary" /> | ||
<AcUnitIcon color="secondary" /> | ||
<AcUnitIcon color="success" /> | ||
<AcUnitIcon color="warning" /> | ||
<AcUnitIcon color="error" /> | ||
<AcUnitIcon color="info" /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
|
||
export default function ColorMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap> | ||
<AcUnitIcon color="primary" /> | ||
<AcUnitIcon color="secondary" /> | ||
<AcUnitIcon color="success" /> | ||
<AcUnitIcon color="warning" /> | ||
<AcUnitIcon color="error" /> | ||
<AcUnitIcon color="info" /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<AcUnitIcon color="primary" /> | ||
<AcUnitIcon color="secondary" /> | ||
<AcUnitIcon color="success" /> | ||
<AcUnitIcon color="warning" /> | ||
<AcUnitIcon color="error" /> | ||
<AcUnitIcon color="info" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; | ||
import AddAPhotoIcon from '@mui/icons-material/AddAPhoto'; | ||
|
||
export default function SizeMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap alignItems="center"> | ||
<AddAPhotoIcon sx={{ fontSize: 10 }} /> | ||
<AcUnitIcon fontSize="small" /> | ||
<AccountBalanceIcon fontSize="large" /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import AcUnitIcon from '@mui/icons-material/AcUnit'; | ||
import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; | ||
import AddAPhotoIcon from '@mui/icons-material/AddAPhoto'; | ||
|
||
export default function SizeMaterialIcon() { | ||
return ( | ||
<Stack spacing={2} direction="row" useFlexGap alignItems="center"> | ||
<AddAPhotoIcon sx={{ fontSize: 10 }} /> | ||
<AcUnitIcon fontSize="small" /> | ||
<AccountBalanceIcon fontSize="large" /> | ||
</Stack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<AddAPhotoIcon sx={{ fontSize: 10 }} /> | ||
<AcUnitIcon fontSize="small" /> | ||
<AccountBalanceIcon fontSize="large" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,13 @@ githubLabel: 'package: icons' | |
|
||
# Material Icons | ||
|
||
<p class="description">2,100+ ready-to-use React Material Icons from the official website.</p> | ||
<p class="description">2,100+ ready-to-use React Material Icons.</p> | ||
|
||
{{"component": "modules/components/ComponentLinkHeader.js"}} | ||
<br/> | ||
|
||
[@mui/icons-material](https://www.npmjs.com/package/@mui/icons-material) | ||
includes the 2,100+ official [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons) converted to [`SvgIcon`](/material-ui/api/svg-icon/) components. | ||
## Introduction | ||
|
||
The [`@mui/icons-material`](https://www.npmjs.com/package/@mui/icons-material) package includes the 2,100+ official [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons) converted to [`SvgIcon`](/material-ui/icons/#svgicon/) components. | ||
It depends on `@mui/material`, which requires Emotion packages. | ||
Use one of the following commands to install it: | ||
|
||
|
@@ -36,7 +36,31 @@ pnpm add @mui/icons-material @mui/material @emotion/styled @emotion/react | |
|
||
See the [Installation](/material-ui/getting-started/installation/) page for additional docs about how to make sure everything is set up correctly. | ||
|
||
<hr/> | ||
## Basics | ||
|
||
Material Icons use the Material UI [SVG Icon](/material-ui/icons/#svgicon/) component under the hood, so they render without any customization, and feature several props for quickly customizing styles. | ||
|
||
{{"demo": "BasicMaterialIcon.js"}} | ||
|
||
:::info | ||
Visit [the SVG Icon component section in the Icon doc](/material-ui/icons/#svgicon/) for further information about its other props, as well as how to use it with other icon libraries. | ||
::: | ||
|
||
### Size | ||
|
||
Use the `fontSize` prop to toggle between small, medium (default, 24x24px), or large icon sizes. | ||
You can also use the `sx` prop to pick arbitrary values that are outside of this built-in scale. | ||
|
||
{{"demo": "SizeMaterialIcon.js"}} | ||
|
||
### Color | ||
|
||
Use the `color` prop to choose a palette key from the theme. | ||
It defaults to the `main` value of its respective palette. | ||
|
||
{{"demo": "ColorMaterialIcon.js"}} | ||
Comment on lines
+49
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should document this, It feels like it doesn't teach people that it's https://deploy-preview-40445--material-ui.netlify.app/material-ui/icons/#svgicon. I think it's better to have them struggle a bit, so that once they figure it out, they can have more autonomy with the product. I feel that the root issue is that we don't correctly link to https://mui.com/material-ui/icons/#material-svg-icons from the relevant places. |
||
|
||
## Browse the library | ||
|
||
Browse through the icons below to find the one you need. | ||
The search field supports synonyms—for example, try searching for "hamburger" or "logout." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error is correct, we shouldn't ignore it.