React Navbar Overview
Ignite UI for React 사용자에게 앱에서의 현재 위치를 알려줍니다. Navigation Bar는 검색이나 즐겨찾기와 같은 빠른 작업에 대한 링크도 제공하여 사용자가 잘못된 경로나 상태로 이동하지 않고도 애플리케이션을 원활하게 탐색할 수 있도록 도와줍니다. 이 바는 배치된 컨테이너의 맨 위에 있습니다.
React Navbar Example
The following example represents a IgrNavbar with icons and text header:
Usage
Before using the IgrNavbar, you need to register it as follows:
Ignite UI for React에 대한 완전한 소개는 '시작 주제'를 읽어보세요.
먼저, 다음 명령을 실행하여 Ignite UI for React 설치해야 합니다.
npm install igniteui-react
You will then need to import the IgrNavbar and its necessary CSS like so:
import { IgrNavbar } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';
<IgrNavbar>
<span>Navigation Title</span>
</IgrNavbar>
Content
You can enhance the IgrNavbar component by adding IgrIcon or other components at the start or end position as content, allowing users to navigate to key positions directly from the bar:
<IgrNavbar>
<div slot="start">
<IgrIcon name="home" collection="material" />
</div>
<h2>Sample App</h2>
<div slot="end">
<IgrIcon name="search" collection="material" />
</div>
...
</IgrNavbar>
Styling
The NavBar component exposes several CSS parts, giving you full control over its style:
| 이름 | 설명 |
|---|---|
base |
탐색 모음의 기본 래퍼입니다. |
start |
왼쪽 맞춤 아이콘 컨테이너입니다. |
middle |
탐색 모음 제목 컨테이너입니다. |
end |
오른쪽에 정렬된 작업 아이콘 컨테이너입니다. |
igc-icon {
color: var(--ig-primary-500);
}
igc-navbar {
background-color: var(--ig-secondary-200);
}
igc-navbar::part(middle) {
font-family: Titillium Web, sans-serif;
color: var(--ig-primary-500);;
}
모든 것이 순조롭게 진행되면 브라우저에 다음이 표시됩니다.