function createButton
createButton(
text: string,
): HTMLButtonElement

Create a button DOM element

Examples

Example 1

const btn = createButton('Save', { variant: 'primary', onClick: () => handleSave() });

Example 2

// With custom theme const btn = createButton('Submit', { variant: 'primary', themeColor: 'violet', });

Parameters

text: string

Button label

optional
options: CreateButtonOptions

Button configuration

Return Type

HTMLButtonElement

HTMLButtonElement

Usage

import { createButton } from ".";