Skip to main content
Version: Next

Button API

import { Button } from '@editora/ui-react';

Props​

PropTypeDescription
animation'scale' | 'pulse' | 'none'
ariaLabelstring
blockboolean
childrenReact.ReactNode
disabledboolean
downloadstring | boolean
endIconReact.ReactNode
headlessboolean
hrefstringMakes it a link that looks like a button (a real <a>: new tab, address on hover, announced as a link). Goes through NavigationProvider like Sidebar and Breadcrumb links.
iconstring
loadingboolean
loadingLabelstring
onNavigate(detail: ComponentNavigateDetail<{ href: string }>) => voidRuns before a link button is followed; detail.preventDefault() keeps the page.
radiusnumber | string
recipe'classic' | 'solid' | 'soft' | 'surface' | 'outline' | 'ghost'
relstring
scale'1' | '2' | '3' | '4'
size'sm' | 'md' | 'lg'
startIconReact.ReactNode
state'idle' | 'loading' | 'error' | 'success'
targetstring
theme'default' | 'dark' | 'brand'
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'
type'button' | 'submit' | 'reset'
variant'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'warning'

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-button>​

Button renders the ui-button custom element from @editora/ui-core, which can also be used without React.

Attributes: animation, aria-expanded, aria-haspopup, aria-label, aria-pressed, block, disabled, download, headless, href, icon, loading, loading-label, radius, recipe, rel, scale, shape, size, state, target, theme, tone, type, variant

Events: submit