Appearance
Callout 컴포넌트
Callout은 중요한 상태, 경고, 에러, 가이드성 메시지를 전달하는 컴포넌트입니다.
아이콘, 타이틀, 설명, 메타 정보, 액션, 닫기 버튼은 모두 prop 또는 slot으로 제어할 수 있고, title / description / meta prop은 내부적으로 v-html로 렌더링됩니다.
Playground
아래 인터페이스에서 아이콘, 컬러, 타입, 설명, 버튼 구성을 직접 바꿔보면서 확인할 수 있습니다.
Basic
theme
type
layout
icon style
title HTML
Icon
icon
Meta
meta HTML
compact와 banner는 우측 inline, titleAndDescription은 하단 stacked로 표시됩니다.
Description
description HTML
compact와 banner에서는 description이 렌더링되지 않습니다.
Action
button type
leading icon
trailing icon
button text
Close
닫기 버튼 표시 여부만 제어합니다.
Preview
마지막 발생 이벤트: 없음
Usage
vue
<template>
<Callout
:icon="ICON_TYPE.info"
theme="info"
type="filled"
layout="titleAndDescription"
title="APM 에이전트가 설치되지 않아 확인할 수 없는 차트들이 있습니다."
description="원격 점검 메뉴 내에서 알림 발생 규칙(APM EVENT 룰)을 관리할 수 있습니다. <a href='#'>자세히 보기</a>"
meta="JENNIFER Kubernetes 버전 1.0.47"
:action="{ text: '업그레이드', type: 'outlined' }"
closeable
/>
</template>
<script setup lang="ts">
import { Callout, ICON_TYPE } from '@jennifersoft/vue-components-v2';
</script>Props
| Prop | 타입 | 기본값 | 설명 |
|---|---|---|---|
icon | IconTypes | - | 기본 아이콘입니다. #icon slot이 있으면 slot이 우선합니다. |
type | 'filled' | 'outlined' | 'filled' | 배경/외곽선 스타일입니다. |
layout | 'banner' | 'compact' | 'titleAndDescription' | undefined | 콘텐츠 배치 방식입니다. 주어지지 않으면 설명 유무에 따라 compact 또는 titleAndDescription으로 추론됩니다. |
theme | 'primary' | 'info' | 'success' | 'warning' | 'error' | 'primary' | 상태 색상 타입입니다. |
iconStyle | 'plain' | 'contained' | 'plain' | 아이콘을 그대로 노출할지, 원형 배경 안에 넣을지 제어합니다. |
title | string | '' | 제목입니다. v-html로 렌더링됩니다. #title slot이 있으면 slot이 우선합니다. |
description | string | undefined | 설명입니다. v-html로 렌더링됩니다. #description slot이 있으면 slot이 우선합니다. |
meta | string | '' | 우측 또는 하단의 메타 정보입니다. v-html로 렌더링됩니다. #meta slot이 있으면 slot이 우선합니다. |
action | string | CalloutAction | undefined | 기본 액션 버튼입니다. #actions slot 또는 기본 슬롯과 함께 사용할 수 있습니다. |
closeable | boolean | false | 기본 닫기 버튼 표시 여부입니다. #close slot이 있으면 커스텀 닫기 UI를 사용할 수 있습니다. |
closeButtonAriaLabel | string | 'Close callout' | 기본 닫기 버튼의 접근성 레이블입니다. |
CalloutAction
| 필드 | 타입 | 기본값 | 설명 |
|---|---|---|---|
text | string | - | 버튼 라벨입니다. |
type | ButtonType | 'outlined' | 버튼 스타일입니다. |
size | Size | 'small' | 버튼 크기입니다. |
leadingIcon | IconTypes | undefined | 버튼 앞 아이콘입니다. |
trailingIcon | IconTypes | undefined | 버튼 뒤 아이콘입니다. |
disabled | boolean | false | 버튼 비활성화 여부입니다. |
Events
| 이벤트 | 설명 |
|---|---|
action | 기본 액션 버튼을 클릭했을 때 발생합니다. |
close | 기본 닫기 버튼을 클릭했을 때 발생합니다. |
Slots
| Slot | 설명 |
|---|---|
icon | 아이콘 영역을 커스텀합니다. |
title | 제목 영역을 커스텀합니다. |
description | 설명 영역을 커스텀합니다. |
meta | 메타 정보 영역을 커스텀합니다. |
actions | 우측 액션 영역을 커스텀합니다. action, close slot prop을 받을 수 있습니다. |
close | 닫기 영역을 커스텀합니다. close slot prop을 받을 수 있습니다. |
default | 기존 호환용 액션 영역 슬롯입니다. actions와 동일한 위치에 렌더링됩니다. |
Examples
기준 테마와 타입 조합별 예시는 아래처럼 확인할 수 있습니다. 각 섹션은 Compact, Banner, Title And Description 조합으로 구성되어 있습니다.
Info Filled
Compact
APM 에이전트가 설치되지 않아 확인할 수 없는 차트들이 있습니다.
Banner
Title And Description
Info Outlined
Compact
설치되지 않은 구성 요소가 있어 일부 차트는 비어 있을 수 있습니다.
Banner
Title And Description
Success Filled
Compact
에이전트 연결이 정상적으로 완료되었습니다.
Banner
Title And Description
Success Outlined
Compact
업데이트가 성공적으로 반영되었습니다.
Banner
Title And Description
Warning Filled
Compact
권장되지 않는 구성이 포함되어 있습니다.
Banner
Title And Description
Warning Outlined
Compact
현재 환경에서는 일부 기능이 제한될 수 있습니다.
Banner
Title And Description
Error Filled
Compact
에이전트 연결에 실패했습니다.
Banner
Title And Description
Error Outlined
Compact
요청 처리 중 오류가 발생했습니다.
Banner
Title And Description
Primary Filled
Compact
새로운 기능을 사용할 수 있습니다.
Banner
Title And Description
Primary Outlined
Compact
구성 가이드를 확인하고 다음 단계를 진행하세요.
Banner
Title And Description
Notes
title,description,metaprop은 모두v-html로 렌더링되므로 외부 입력을 그대로 넣을 때는 호출부에서 sanitize가 필요합니다.layout을 주지 않으면description유무에 따라compact또는titleAndDescription으로 자동 결정됩니다.banner는 명시적으로 지정해야 합니다.compact와banner는meta를 inline으로 표시하고,titleAndDescription은meta를 하단에 stacked로 표시합니다.compact와banner는description을 렌더링하지 않고,titleAndDescription에서만description이 표시됩니다.action,closeable,meta,iconStyle,layout은 기존 API를 깨지 않도록 optional 확장으로 추가된 인터페이스입니다.