1. Ant Design
- https://ant.design/docs/react/introduce
- https://ant.design/docs/react/use-with-create-react-app
- https://ant.design/components/overview/
- React ๊ธฐ๋ฐ
- Day.js ๊ถ์ฅ, Moment.js ์ ๊ฑฐ ์ถ์ฒ
- Design ์ฒ ํ : ๋จ์ํ ์ปดํฌ๋ํธ ์ ๊ณต + @
- typography : ๋ค์ํ ์ฌ์ด์ฆ์ Text ์ ๊ณต
1$ npm install antd
2. ์์ 1 : ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
2.1 App.js
1// Webpack CSS import2// import 'onsenui/css/onsenui.css';3// import 'onsenui/css/onsen-css-components.css';4// import OnesenUIExample from './components/OnsenUI/OnesenUIExample';5import '~antd/dist/antd.css' // ์ถ๊ฐ-----------------6import AntDesignExample from './components/AntDesign/AntDesignExample'78export default function App() {9return (10<>11<AntDesignExample />12{/* <OnesenUIExample /> */}13</>14)15}
2.2 AntDesignExample
1// src\components\AntDesign\AntDesignExample.jsx2import React from 'react'3import GetStart from './GetStart'45export default function AntDesignExample() {6return (7<div>8<GetStart />9</div>10)11}
2.3 GetStart
1import { useState } from 'react'2import { DatePicker, message, Alert } from 'antd'34export default function GetStart() {5const [date, setDate] = useState(null)6const handleChange = value => {7message.info(`Selected Date: ${value ? value.format('YYYY-MM-DD') : 'None'}`)8setDate(value)9}10return (11<div style={{ width: 400, margin: '100px auto' }}>12<DatePicker onChange={handleChange} />13<div style={{ marginTop: 16 }}>14<Alert message="Selected Date" description={date ? date.format('YYYY-MM-DD') : 'None'} />15</div>16</div>17)18}
3. ์์ 2 : Icon
1$ npm install --save @ant-design/icons
3.1 IconExample
1import { SearchOutlined } from '@ant-design/icons'2import { Button, Tooltip, Space } from 'antd'34export default function IconExample() {5return (6<Space direction="vertical">7<Space wrap>8<Tooltip title="search">9<Button type="primary" shape="circle" icon={<SearchOutlined />} />10</Tooltip>11<Button type="primary" shape="circle">12A13</Button>14<Button type="primary" icon={<SearchOutlined />}>15Search16</Button>17<Tooltip title="search">18<Button shape="circle" icon={<SearchOutlined />} />19</Tooltip>20<Button icon={<SearchOutlined />}>Search</Button>21</Space>22<Space wrap>23<Tooltip title="search">24<Button shape="circle" icon={<SearchOutlined />} />25</Tooltip>26<Button icon={<SearchOutlined />}>Search</Button>27<Tooltip title="search">28<Button type="dashed" shape="circle" icon={<SearchOutlined />} />29</Tooltip>30<Button type="dashed" icon={<SearchOutlined />}>31Search32</Button>33<Button icon={<SearchOutlined />} href="https://www.google.com" />34</Space>35</Space>36)37}