본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Flowbite 스피드 다이얼 (Speed Dial)

원문 보기 위키 갱신

사용자가 화면의 고정된 위치에서 여러 메뉴 항목에 빠르게 접근할 수 있게 해주는 스피드 다이얼 컴포넌트를 배워요. 트리거 버튼에 data-dial-toggle 데이터 속성을 붙이면 되는데, 그 값이 대상 요소의 ID예요.

출처: 문서

본문

스피드 다이얼은 숨겨진 여러 작업 버튼을 한 번에 접근할 수 있게 해서, 공유, 인쇄, 다운로드, 복사 같은 동작을 화면 어디서든 빠르게 실행하고 싶을 때 유용해요.

기본 스피드 다이얼 (Default speed dial)

버튼을 클릭하면 menu items 목록과 툴팁이 나타나는 기본 스피드 다이얼이에요. data-dial-toggle 속성 값이 대상 요소(id="speed-dial-menu-default")를 가리켜요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-default" class="mb-4 flex hidden flex-col items-center space-y-2">
        <button type="button" data-tooltip-target="tooltip-share" data-tooltip-placement="left" class="flex h-10 w-10 items-center justify-center rounded-full border border-default-medium bg-neutral-primary-medium text-body shadow-lg hover:bg-neutral-tertiary-soft focus:ring-4 focus:ring-brand-soft">
            <svg class="h-5 w-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M18 5V3a1 1 0 0 0-1-1h-3a1 1 0 0 0-.995.9L13 3.534A7 7 0 0 0 6.1 5.8 7 7 0 0 0 5 11v.1l2 2v-2.1a5 5 0 0 1 .78-2.68 5 5 0 0 1 3.22-2.16L11 6.67V9a1 1 0 0 0 1.7.7l3-3A1 1 0 0 0 15 5.3L11 1.3 15.7 6a1 1 0 0 0 .3-.3 7 7 0 0 1 3 5.3V11l-2-2v1.1a7 7 0 0 1 0 5.8V17a7 7 0 0 1-3 5.3c.3-.3.3-.3.3-.3s0 .4 0 0a1 1 0 0 0 .7-1.7l-4-4a1 1 0 0 0-1.7.7v2.3l-1.7-1.7.3-.3a5 5 0 0 0 .7-2.7V15a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v2a5 5 0 0 0 .78 2.68A5 5 0 0 0 10 20.16V22l-3-3-3.7 6.7A1 1 0 0 0 4 27h3Z" clip-rule="evenodd"/></svg>
            <span class="sr-only">Share</span>
        </button>
        <div id="tooltip-share" role="tooltip" class="absolute z-10 invisible inline-block w-auto rounded-lg border border-default-medium bg-neutral-primary-medium px-3 py-2 text-sm font-medium text-heading shadow-xl opacity-0 transition-opacity duration-300">Share</div>
        <!-- Print, Download, Copy 버튼이 같은 구조로 반복됨 -->
    </div>
    <button type="button" id="speed-dial-button" data-dial-toggle="speed-dial-menu-default" aria-controls="speed-dial-menu-default" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

사각형 스피드 다이얼 (Square speed dial)

트리거 버튼을 rounded-lg 같은 클래스로 사각형 모양으로 바꾼 변형이에요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-square" class="mb-4 flex hidden flex-col items-center space-y-2">
        <button type="button" data-tooltip-target="tooltip-share-square" data-tooltip-placement="left" class="flex h-10 w-10 items-center justify-center rounded-lg border border-default-medium bg-neutral-primary-medium text-body shadow-lg hover:bg-neutral-tertiary-soft focus:ring-4 focus:ring-brand-soft">
            <!-- Share 아이콘 -->
            <span class="sr-only">Share</span>
        </button>
        <div id="tooltip-share-square" role="tooltip" class="absolute z-10 invisible inline-block w-auto rounded-lg border border-default-medium bg-neutral-primary-medium px-3 py-2 text-sm font-medium text-heading shadow-xl opacity-0 transition-opacity duration-300">Share</div>
        <!-- Print, Download, Copy 버튼이 같은 구조로 반복됨 -->
    </div>
    <button type="button" id="speed-dial-button-square" data-dial-toggle="speed-dial-menu-square" aria-controls="speed-dial-menu-square" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-lg bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

버튼 안 텍스트 (Text inside button)

스피드 다이얼 안에 텍스트를 포함시킨 변형이에요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-text-inside" class="mb-4 flex hidden flex-col items-center space-y-2">
        <button type="button" class="flex items-center justify-center gap-2 rounded-full border border-default-medium bg-neutral-primary-medium px-2 py-2 text-sm font-medium text-body shadow-lg hover:bg-neutral-tertiary-soft hover:text-heading focus:ring-4 focus:ring-brand-soft">
            <svg class="h-5 w-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm3-11h-2a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V10h1a1 1 0 0 0 0-2Z" clip-rule="evenodd"/></svg>
            Share
        </button>
        <!-- Print, Download, Copy ... -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-text-inside" aria-controls="speed-dial-menu-text-inside" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

버튼 밖 텍스트 (Text outside button)

버튼 바깥에 텍스트를 배치한 변형이에요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-text-outside" class="mb-4 flex hidden flex-col items-center space-y-2">
        <button type="button" class="flex items-center justify-center gap-2 rounded-full border border-default-medium bg-neutral-primary-medium px-2 py-2 shadow-lg hover:bg-neutral-tertiary-soft focus:ring-4 focus:ring-brand-soft">
            <svg class="h-5 w-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M6 9h8m-8 0V5m0 4v5a1 1 0 0 0 1 1h4"/></svg>
        </button>
        <a href="#" class="ms-1 text-xs font-medium text-body hover:text-heading">Share</a>
        <!-- Print, Download, Copy ... -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-text-outside" aria-controls="speed-dial-menu-text-outside" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

드롭다운 메뉴 (Dropdown menu)

스피드 다이얼 대신 드롭다운 스타일의 메뉴 항목을 이어지는 리스트로 보여주는 변형이에요.

<div id="speed-dial" class="relative flex flex-col items-center justify-center w-32 py-2">
    <div id="speed-dial-menu-dropdown" class="mb-4 hidden bg-neutral-primary-medium border border-default-medium rounded-lg shadow-lg w-44">
        <ul class="py-1 text-sm text-body font-medium">
            <li>
                <a href="#" class="inline-flex items-center w-full px-3 py-2 hover:bg-neutral-tertiary-medium hover:text-heading">
                    <svg class="w-3.5 h-3.5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M18 5V3a1..."/></svg>
                    Share
                </a>
            </li>
            <!-- Print, Download, Copy 항목이 같은 구조로 반복됨 -->
        </ul>
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-dropdown" aria-controls="speed-dial-menu-dropdown" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

이 예시는 메뉴 항목의 리스트를 보여줄 때 대안적인 스타일을 보여줘요.

위치 지정 (Positioning)

top-{*}, right-{*}, bottom-{*}, left-{*} 유틸리티 클래스로 화면의 다른 구석에 스피드 다이얼을 배치할 수 있어요.

오른쪽 상단 (Top right)

top-5 right-5 클래스를 사용해 오른쪽 상단에 배치해요.

<div id="speed-dial" class="relative fixed top-5 right-5">
    <div id="speed-dial-menu-top-right" class="mb-4 flex hidden flex-col items-center space-y-2">
        <!-- Share, Print, Download, Copy 버튼 -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-top-right" aria-controls="speed-dial-menu-top-right" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

오른쪽 하단 (Bottom right)

bottom-5 right-5 클래스를 사용해 오른쪽 하단에 배치해요. (같은 구조로 bottom/left 클래스만 변경)

<div id="speed-dial" class="relative fixed bottom-5 right-5">
    <div id="speed-dial-menu-bottom-right" class="mb-4 flex hidden flex-col items-center space-y-2">
        <!-- 메뉴 버튼들 -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-bottom-right" aria-controls="speed-dial-menu-bottom-right" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

bottom-{*}와 left-{*}를 함께 쓰면 왼쪽 하단, top-{*}와 left-{*}를 함께 쓰면 왼쪽 상단에 배치할 수 있어요.

정렬 (Alignment)

기본적으로 스피드 다이얼의 메뉴 항목은 flex-col 유틸리티 클래스를 사용해 수직(세로)으로 정렬돼요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-vertical" class="mb-4 flex hidden flex-col items-center space-y-2">
        <!-- Share, Print, Download, Copy 버튼이 세로로 정렬됨 -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-vertical" aria-controls="speed-dial-menu-vertical" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

flex-row 및 me-{*} 클래스를 사용하면 메뉴 항목을 수평(가로)으로 정렬할 수 있어요.

<div id="speed-dial" class="relative">
    <div id="speed-dial-menu-horizontal" class="me-4 flex hidden items-center space-x-2">
        <!-- Share, Print, Download, Copy 버튼이 가로로 정렬됨 -->
    </div>
    <button type="button" data-dial-toggle="speed-dial-menu-horizontal" aria-controls="speed-dial-menu-horizontal" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

트리거 방식 (Triggering)

data-dial-trigger="{click|hover}" 데이터 속성으로 스피드 다이얼이 보여지는 이벤트를 설정할 수 있어요. 각 스피드 다이얼의 기본 트리거 방식은 hover예요.

<button type="button" data-dial-toggle="speed-dial-menu-hover" data-dial-trigger="click" aria-controls="speed-dial-menu-hover" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
    <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
    <span class="sr-only">Open actions menu</span>
</button>

data-dial-toggle 데이터 속성의 값으로 click을 지정하면 클릭했을 때만 메뉴가 열려요.

JavaScript 동작 (JavaScript behaviour)

스피드 다이얼을 프로그래밍 방식으로 제어하려면 Dial 객체를 사용해요. 아래는 매개변수와 옵션, 메서드 정보예요.

객체 매개변수 (Object parameters)

파라미터 타입 필수 설명
parentEl Element 필수 스피드 다이얼 컴포넌트를 감싸는 부모 요소예요.
triggerEl Element 필수 스피드 다이얼의 트리거로 사용할 버튼을 지정해요.
targetEl Element 필수 토글될 menu items/buttons 목록이 담긴 요소예요.
options Object 선택 트리거 타입과 기타 옵션을 설정해요.
instanceOptions Object 선택 인스턴스 옵션(id, override)을 설정해요.

옵션 (Options)

옵션 타입 설명
triggerType String 스피드 다이얼을 트리거할 이벤트 타입(hover|click|none)을 지정해요.
onHide Function 스피드 다이얼이 숨겨졌을 때 호출되는 콜백 함수예요.
onShow Function 스피드 다이얼이 보여질 때 호출되는 콜백 함수예요.
onToggle Function 스피드 다이얼이 토글될 때 호출되는 콜백 함수예요.

메서드 (Methods)

메서드 설명
show() 스피드 다이얼의 menu items/buttons 목록을 보여줘요.
hide() 스피드 다이얼의 menu items/buttons 목록을 숨겨요.
toggle() 스피드 다이얼의 보임/숨김을 토글해요.
updateOnShow(callback) 다이얼이 보여졌을 때 호출할 콜백을 설정해요.
updateOnHide(callback) 다이얼이 숨겨졌을 때 호출할 콜백을 설정해요.
updateOnToggle(callback) 다이얼의 보임 상태가 바뀌었을 때 호출할 콜백을 설정해요.

예시 (Example)

Dial 객체를 만들 때 필요한 요소들을 먼저 가져와요.

// parent element wrapping the speed dial
const $parentEl = document.getElementById('dialParent');

// the trigger element that can be clicked or hovered
const $triggerEl = document.getElementById('dialButton');

// the content wrapping element of menu items or buttons
const $targetEl = document.getElementById('dialContent');

// options with default values
const options = {
    triggerType: 'click',
    onHide: () => {
        console.log('speed dial is shown');
    },
    onShow: () => {
        console.log('speed dial is hidden');
    },
    onToggle: () => {
        console.log('speed dial is toggled');
    },
};

// instance options with default values
const instanceOptions = {
    id: 'dialContent',
    override: true
};

내보낸 Dial 클래스를 불러와 새 객체를 만들 수 있어요.

import { Dial } from 'flowbite';
/*
* $parentEl: required
* $targetEl: required
* $triggerEl: required
* options: optional
* instanceOptions: optional
*/
const dial = new Dial($parentEl, $triggerEl, $targetEl, options, instanceOptions);

show, hide, toggle 메서드를 사용해 스피드 다이얼을 제어할 수 있어요.

// show the speed dial
dial.show();

// hide the speed dial
dial.hide();

// toggle the visibility of the speed dial
dial.toggle();

HTML 마크업 (HTML Markup)

위 JavaScript 예시에서 사용할 HTML 마크업이에요. dialContent 요소가 menu items 리스트를 감싸고, dialButton이 트리거 버튼이에요.

<div id="speed-dial" class="relative">
    <div id="dialContent" class="mb-4 flex hidden flex-col items-center space-y-2">
        <button type="button" data-tooltip-target="tooltip-share" data-tooltip-placement="left" class="flex h-10 w-10 items-center justify-center rounded-full border border-default-medium bg-neutral-primary-medium text-body shadow-lg hover:bg-neutral-tertiary-soft focus:ring-4 focus:ring-brand-soft">
            <svg class="h-5 w-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 18 18"><path fill-rule="evenodd" d="M18 5V3a1 1 0 0 0-1-1h-3a1 1 0 0 0-.995.9L13 3.534A7 7 0 0 0 6.1 5.8 7 7 0 0 0 5 11v.1l2 2v-2.1a5 5 0 0 1 .78-2.68 5 5 0 0 1 3.22-2.16L11 6.67V9a1 1 0 0 0 1.7.7l3-3A1 1 0 0 0 15 5.3L11 1.3 15.7 6a1 1 0 0 0 .3-.3 7 7 0 0 1 3 5.3V11l-2-2v1.1a7 7 0 0 1 0 5.8V17a7 7 0 0 1-3 5.3c.3-.3.3-.3.3-.3s0 .4 0 0a1 1 0 0 0 .7-1.7l-4-4a1 1 0 0 0-1.7.7v2.3l-1.7-1.7.3-.3a5 5 0 0 0 .7-2.7V15a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v2a5 5 0 0 0 .78 2.68A5 5 0 0 0 10 20.16V22l-3-3-3.7 6.7A1 1 0 0 0 4 27h3Z" clip-rule="evenodd"/></svg>
            <span class="sr-only">Share</span>
        </button>
        <div id="tooltip-share" role="tooltip" class="absolute z-10 invisible inline-block w-auto rounded-lg border border-default-medium bg-neutral-primary-medium px-3 py-2 text-sm font-medium text-heading shadow-xl opacity-0 transition-opacity duration-300">Share</div>
        <!-- Print, Download, Copy 버튼 반복 -->
    </div>
    <button type="button" id="dialButton" aria-controls="speed-dial-menu-default" aria-expanded="false" class="flex h-14 w-14 items-center justify-center rounded-full bg-brand text-white shadow-lg transition-transform hover:bg-brand-strong hover:rotate-45 focus:ring-4 focus:ring-brand-medium focus:outline-none">
        <svg class="h-5 w-5 transition-transform group-hover:rotate-45" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 18 18"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 1v16M1 9h16"/></svg>
        <span class="sr-only">Open actions menu</span>
    </button>
</div>

TypeScript

TypeScript 설정을 사용 중이라면 Flowbite에서 가져온 타입을 코드에 적용할 수 있어요.

import { Dial } from 'flowbite';
import type { DialOptions, DialInterface } from 'flowbite';
import type { InstanceOptions } from 'flowbite';

// parent element wrapping the speed dial
const $parentEl: HTMLElement = document.getElementById('dialParent');

// the trigger element that can be clicked or hovered
const $triggerEl: HTMLElement = document.getElementById('dialButton');

// the content wrapping element of menu items or buttons
const $targetEl: HTMLElement = document.getElementById('dialContent');

// options with default values
const options: DialOptions = {
    triggerType: 'hover',
    onHide: () => {
        console.log('speed dial is shown');
    },
    onShow: () => {
        console.log('speed dial is hidden');
    },
    onToggle: () => {
        console.log('speed dial is toggled');
    },
};

// instance options with default values
const instanceOptions: InstanceOptions = {
    id: 'dialContent',
    override: true
};

const dial: DialInterface = new Dial($parentEl, $triggerEl, $targetEl, options);

// show the speed dial
dial.show();

더 알아보기 (Learn more)