0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MUI

Last updated at Posted at 2022-08-15

MUIとは

  • React用デザインライブラリ
  • 画面全体からではなくコンポーネント単位からデザインするのが特徴

インストール

パッケージ名自体が変わることが多く、パッケージ名とReactバージョンの依存関係に注意

npm install @mui/material @emotion/react @emotion/styled

サンプル

import * as React from 'react';
import Button from '@mui/material/Button';

function App() {
  return <Button variant="contained">Hello World</Button>;
}

コンポーネント

ボタン

import Button from '@mui/material/Button'

チェックマーク

アイコン

npm install @material-ui/icons # React17まで
npm install @mui/icons-material # React18から
<Icon color="primary">add_circle</Icon>

ヘッダー

<Typography variant="h1" component="h2">
  h1. Heading
</Typography>

リスト

<List component="nav" className={classes.root} aria-label="contacts">
  <ListItem button>
    <ListItemIcon>
      <StarIcon />
    </ListItemIcon>
    <ListItemText primary="Chelsea Otakan" />
  </ListItem>
  <ListItem button>
    <ListItemText inset primary="Eric Hoffman" />
  </ListItem>
</List>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?