function createIconOnlyButton
createIconOnlyButton(
icon: string | HTMLElement,
options: CreateButtonOptions & { ariaLabel: string; }
): HTMLButtonElement

Create an icon-only button

Examples

Example 1

const closeBtn = createIconOnlyButton('<i class="ph ph-x"></i>', { ariaLabel: 'Close', variant: 'ghost', size: 'sm', });

Parameters

icon: string | HTMLElement

Icon HTML string or element

options: CreateButtonOptions & { ariaLabel: string; }

Button options plus aria-label (required for accessibility)

Return Type

HTMLButtonElement

HTMLButtonElement

Usage

import { createIconOnlyButton } from ".";