탭 (Tab)
SlTab은 탭 그룹(tab group) 안에서 탭 패널(tab panel) 을 나타내고 활성화하는 데 사용되는 요소예요. 더 다양한 데모는 탭 그룹 예시에서 확인할 수 있습니다.
출처: 문서
본문
불러오기 (Importing)
autoloader나 전통적인 loader를 사용 중이라면 이 부분은 무시해도 돼요. 그게 아니라면 아래 스니펫 중 원하는 방식으로 이 컴포넌트만 골라서 불러올 수 있어요.
Script 태그로 CDN에서 이 컴포넌트를 불러오려면:
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/components/tab/tab.js"></script>
JavaScript import 구문으로 CDN에서 불러오려면:
import 'https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/components/tab/tab.js';
번들러(bundler)를 사용해 불러오려면:
import '@shoelace-style/shoelace/dist/components/tab/tab.js';
React 컴포넌트로 불러오려면:
import SlTab from '@shoelace-style/shoelace/dist/react/tab';
슬롯 (Slots)
| Name | Description |
|---|---|
| (default) | The tab’s label. |
슬롯 사용법에 대해 더 알아보기.
속성 (Properties)
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
panel |
The name of the tab panel this tab is associated with. The panel must be located in the same tab group. | string |
'' |
|
active |
Draws the tab in an active state. | boolean |
false |
|
closable |
Makes the tab closable and shows a close button. | boolean |
false |
|
disabled |
Disables the tab and prevents selection. | boolean |
false |
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
속성(attribute)과 프로퍼티(property)에 대해 더 알아보기.
이벤트 (Events)
| Name | React Event | Description | Event Detail |
|---|---|---|---|
sl-close |
onSlClose |
Emitted when the tab is closable and the close button is activated. | - |
이벤트에 대해 더 알아보기.
파트 (Parts)
| Name | Description |
|---|---|
base |
The component’s base wrapper. |
close-button |
The close button, an ``. |
close-button__base |
The close button’s exported base part. |
CSS 파트 커스터마이징에 대해 더 알아보기.
의존성 (Dependencies)
이 컴포넌트는 다음 의존성을 자동으로 불러옵니다.
- ``
- ``