[REACT] 5_앱 Card 컨텐츠 구성
2021. 12. 27. 12:58ㆍReact/React 쇼핑 앱
반응형
앱 Card 컨텐츠 구성 : 카드 컴포넌트 추가
function Card(props) {
return (
<>
<div>카드</div>
</>
)
}
Card 컴포넌트 배치 : 전체 1개의 컨테이너안에 행들로 구성
App.js
더보기
import logo from './logo.svg';
import './App.css';
import { Navbar, NavDropdown, Nav, Container } from 'react-bootstrap';
function App() {
return (
<div className="App">
{/* NavBar */}
<Navbar collapseOnSelect expand="lg" bg="dark" variant="dark">
<Container>
<Navbar.Brand href="/">React-Bootstrap</Navbar.Brand>
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
<Navbar.Collapse id="responsive-navbar-nav">
<Nav className="me-auto">
<Nav.Link href="/">Home</Nav.Link>
<Nav.Link href="#pricing">Pricing</Nav.Link>
<NavDropdown title="Dropdown" id="collasible-nav-dropdown">
<NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item>
<NavDropdown.Item href="#action/3.2">Another action</NavDropdown.Item>
<NavDropdown.Item href="#action/3.3">Something</NavDropdown.Item>
<NavDropdown.Divider />
<NavDropdown.Item href="#action/3.4">Separated link</NavDropdown.Item>
</NavDropdown>
</Nav>
<Nav>
<Nav.Link href="#login">로그인</Nav.Link>
<Nav.Link eventKey={2} href="#join">
회원가입
</Nav.Link>
</Nav>
</Navbar.Collapse>
</Container>
</Navbar>
{/* jumbotron */}
<div class="bg-light p-5 rounded-lg">
<h1 class="display-4">Hello, world!</h1>
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<hr class="my-4" />
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</div>
{/* card contents */}
<div className='container'>
<div className='row'>
<Card />
</div>
</div>
{/* more button */}
</div>
);
}
function Card(props) {
return (
<>
<div>카드</div>
</>
)
}
export default App;
반응형
'React > React 쇼핑 앱' 카테고리의 다른 글
[REACT] 7_더보기 버튼 구성 및 기능구현 (0) | 2021.12.27 |
---|---|
[REACT] 6_앱 Card 컨텐츠 구성 2 (0) | 2021.12.27 |
[REACT] 4_앱 Jumbotron 구성 (0) | 2021.12.25 |
[REACT] 3_앱 Navbar 구성 (0) | 2021.12.25 |
[REACT] 2_리액트 부트스트랩 설치 및 구성 (0) | 2021.12.25 |