Vitepress Theme Akari Docsv1.0.0GitHubSettingsMore

Buttons: API ​

The content below comes from the component metadata of @m3e/web 2.10.3.

m3e-button ​

AttributeValuesDefaultDescription
variantelevated, filled, tonal, outlined, texttextAppearance
sizeextra-small, small, medium, large, extra-largesmallSize
shaperounded, squareroundedShape
disabledBooleanfalseDisabled and not focusable
disabled-interactiveBooleanfalseDisabled but still focusable, so readers can discover the action
toggleBooleanfalseActs as a two-state toggle
selectedBooleanfalseSelected state of the toggle
hrefString""Makes the button a link when set
target_self, _blank, _parent, _top or a window name""Where the link opens
relString""Relationship between the link and the current page
downloadStringNoneMakes it a download link; the value is the file name
typebutton, submit, resetbuttonBehavior in a form
name, valueStringNoneName and value sent when the form is submitted
SlotContent
(default)Button text
iconIcon before the text
trailing-iconIcon after the text
selectedText when selected
selected-iconIcon when selected
EventWhen
clickOn click
beforeinputThe toggle is about to switch; can be canceled
input, changeThe toggle has switched

m3e-icon-button ​

Same attributes as m3e-button, plus:

AttributeValuesDefaultDescription
variantstandard, filled, tonal, outlined, elevatedstandardAppearance
widthdefault, narrow, widedefaultWidth
SlotContent
(default)Icon
selectedIcon when selected

Events are the same as for m3e-button.

m3e-tooltip ​

AttributeValuesDefaultDescription
forElement idNoneThe control the tooltip belongs to
positionabove, below, before, afterbelowPosition relative to the control
show-delayMilliseconds0Delay before showing
hide-delayMilliseconds200Delay before hiding
touch-gesturesauto, on, offautoHow touch gestures are handled
disabledBooleanfalseDisables the tooltip

Using buttons in docs ​

  • An internal m3e-button with href is taken over by the theme and switches pages in place; target="_self" loads the full page. When you need to navigate from script, call useRouter().go(). See Navigation.
  • Whatever its visual size, a button keeps a touch target of at least 48×48dp.
  • The theme's m3e.ts registers the components (@m3e/web/button, @m3e/web/icon-button, @m3e/web/tooltip).
GitHub Settings

Search the docs

Type a page title, a component name or words from the text.

Press ⌘/Ctrl + K to open it anytime

Choose a language

EnglishEnglish (United States)العربيةArabic (Saudi Arabia)FrançaisFrench (France)日本語Japanese (Japan)한국어Korean (South Korea)简体中文Chinese (China)

Settings

Color
VariantTonal SpotVibrantFidelityExpressiveMonochromeNeutralRainbowFruit Salad
ContrastDefaultMediumHigh
MotionStandardExpressive
Text directionFollow languageLeft to rightRight to left
Text size100%150%200%