Skip to content

Component contract ​

Both renderers use shared Vue declarations and derived template types. Box, Row, Column, Text, Button and Input now derive their props from framework-free core metadata. The API remains experimental; see architecture and support.

Names, defaults and slots ​

Register components with createMavis() or import them individually. Vue accepts both MButton and m-button. With no theme provider, an individually imported component uses Mavis; changing themes across a screen requires the shared app provider.

ComponentMain defaultsDefault slotEvents
Screenscroll=falseScreen contentNone
Rowgap=none, align=center, justify=start, wrap=falseChild componentsNone
Columngap=none, align=stretch, justify=start, wrap=falseChild componentsNone
BoxNo padding or radiusLayers in drawing orderNone
Cardpadding=lg, radius=lg, gap=none, interactive=false, disabled=falseVertical contentclick, no payload
Textvariant=body, tone=text, as=p, align=left, wrap=trueText and MSpanNone
Iconsize=md, tone=text; name required; label optionalNoneNone
Buttonvariant=primary, size=md, disabled=false, loading=falseText onlyclick, no payload
SlidermodelValue=0, min=0, max=100, step=1, disabled=false; label requiredNoneupdate:modelValue, number
InputmodelValue='', type=text, multiline=false, rows=3; label requiredNoneupdate:modelValue and submit, string; focus/blur/action, no payload
Revealshow=false; Column layout defaultsConditional child componentsNone
Sheetopen=false, dismissible=true, fullscreen=false, padding=lg; title or accessibilityLabel requiredSheet contentupdate:open, boolean; close, reason

Text accepts plain/interpolated text and portable MSpan emphasis. Button keeps its default slot text-only and provides decorative leading/trailing slots; interactive children belong outside the button. Other arbitrary nested content is rejected. An explicit text prop, including an empty string, takes precedence over the slot. A loading Button uses loadingText (default Loading…) and cannot emit click. A Card emits click only when interactive and enabled. An interactive Card represents one action: keep buttons, links and fields outside it.

Foundation properties ​

These tables come directly from the contracts consumed by the renderers. — means no explicit default; a theme/context may supply the effective value. See architecture for units and event mappings.

MBox
PropKind / valuesDefaultConstraints
idstring——
accessibilityLabelstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
paddingstring | number—token: space, units: layout
paddingXstring | number—token: space, units: layout
paddingYstring | number—token: space, units: layout
radiusstring | number—token: radius, units: layout
widthnumber | string—units: dimension
heightnumber | string—units: dimension
backgroundColorstring——
borderWidthnumber—units: layout
borderColorstring——
motionSurfaceobject—runtime only
motionRegionobject—runtime only
perspectivenumber——
sharedTagstring——
MRow
PropKind / valuesDefaultConstraints
idstring——
accessibilityLabelstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
paddingstring | number—token: space, units: layout
paddingXstring | number—token: space, units: layout
paddingYstring | number—token: space, units: layout
radiusstring | number—token: radius, units: layout
widthnumber | string—units: dimension
heightnumber | string—units: dimension
backgroundColorstring——
gapstring | number—token: space, units: layout
justifystart | center | end | between | around"start"—
wrapbooleanfalse—
motionRegionobject—runtime only
alignstart | center | end | stretch"center"—
MColumn
PropKind / valuesDefaultConstraints
idstring——
accessibilityLabelstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
paddingstring | number—token: space, units: layout
paddingXstring | number—token: space, units: layout
paddingYstring | number—token: space, units: layout
radiusstring | number—token: radius, units: layout
widthnumber | string—units: dimension
heightnumber | string—units: dimension
backgroundColorstring——
gapstring | number—token: space, units: layout
justifystart | center | end | between | around"start"—
wrapbooleanfalse—
motionRegionobject—runtime only
alignstart | center | end | stretch"stretch"—
MText
PropKind / valuesDefaultConstraints
motionSurfaceobject—runtime only
weightstring—token: fontWeight
idstring——
accessibilityLabelstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
textstring——
asp | span | h1 | h2 | h3 | h4 | h5 | h6"p"—
variantdisplay | title | heading | body | caption | overline"body"—
tonebackground | surface | elevated | text | muted | primary | onPrimary | primarySoft | accent | onAccent | accentSoft | border | warning | success | danger"text"token: palette
alignleft | center | right"left"—
wrapbooleantrue—
maxLinesnumber——
MButton
PropKind / valuesDefaultConstraints
hrefstring——
target_self | _blank"_self"—
relstring——
navigatefunction—runtime only
reorderHandlebooleanfalse—
motionSurfaceobject—runtime only
idstring——
accessibilityLabelstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
textstring——
typebutton | submit | reset"button"—
namestring——
valuestring——
formstring——
variantprimary | secondary | ghost"primary"—
sizesm | md | lg"md"—
disabledbooleanfalse—
loadingbooleanfalse—
loadingIndicatornone | dots | bars | ring"none"—
loadingTextstring"Loading…"—
iconstring—token: icon
trailingIconstring—token: icon
MInput
PropKind / valuesDefaultConstraints
idstring——
accessibilityHiddenboolean——
grownumber0—
shrinknumber——
widthnumber | string—units: dimension
modelValuestring""—
labelstring—required
floatingLabelbooleanfalse—
placeholderstring""—
helperTextstring""—
errorstring""—
typetext | email | password | tel | url | search"text"—
namestring——
autocompletestring——
requiredbooleanfalse—
inputmodestring——
formstring——
disabledbooleanfalse—
readonlybooleanfalse—
multilinebooleanfalse—
rowsnumber3—
maxLengthnumber——
autocapitalizenone | sentences | words | characters——
autocorrectboolean——
returnKeydone | next | go | search | send"done"—
trailingActionobject——
iconstring—token: icon
trailingIconstring—token: icon

Layout values ​

Row, Column, Box, Card and Reveal accept padding, paddingX, paddingY, radius, grow, shrink, width, height and backgroundColor. Reveal also accepts the Column alignment, gap and wrapping props. Button and Text expose grow and shrink; Screen, Slider and Sheet have their own layout behavior, and Sheet applies padding, gap and align to its panel and content column.

  • Spacing accepts theme tokens or finite, non-negative numbers. Axis padding overrides the corresponding sides of padding, including an explicit zero.
  • Radius accepts a theme radius token or a finite, non-negative number.
  • Dimensions accept finite, non-negative numbers, percentages such as 50%, or auto. Numbers mean DIPs on native and CSS pixels on Web. Parent constraints determine percentage sizing.
  • grow defaults to 0. shrink defaults to 1 inside Row and 0 inside Column. Both accept finite, non-negative numbers. Screen establishes a column context; Reveal participates in its parent layout and establishes a column for its children.

Invalid numeric values, spacing/radius tokens and portable dimensions throw a RangeError in both renderers. Enumerated props such as variant and align are checked by TypeScript and Vue's development validators. Unsupported values are not part of the API.

Controlled values ​

Slider displays the closest allowed value without rewriting an out-of-range or unsnapped external model. User interaction emits a number only when the displayed value changes; disabled controls emit nothing. Updating the model from the application does not itself emit another update.

The final step reaches max even if the interval is shorter. For min=0, max=1, step=0.3, the allowed values are 0, 0.3, 0.6, 0.9, 1. A supplied value of 0.96 displays 1; a value of 0.94 displays 0.9. Floating point rounding must not add an extra duplicate step.

Attributes and platform boundaries ​

id identifies the rendered root, except on Input, Switch and Checkbox where it identifies the editor or toggle. accessibilityLabel and accessibilityHidden are typed common props, mapped to native accessibility properties and Web ARIA attributes. Slider uses its required label as the accessible name. Do not hide interactive controls from accessibility.

class, style and other undeclared attributes are forwarded to the rendered root; Reveal forwards them to its conditional column. Local styles override theme styles, and a layout prop that is not given leaves its style key untouched, so native attributes such as paddingTop survive re-renders. These are platform escape hatches: browser CSS, native properties and raw platform events are not portable Mavis APIs. Undeclared props accidentally consumed by an internal wrapper are not guaranteed behavior. Use click and v-model for shared interactions. Button enabled/loading state and Slider range/value fields remain owned by their declared props.

Native Screen renders a Page and needs a navigation host; Web Screen renders main. Native layouts use native views, Web layouts use flex/grid. Native Android sliders use step indices internally; iOS preserves its semantic native range. Button/Card/Reveal use Jolt in both environments; see motion. Font metrics, safe areas and navigation transitions can differ.

Native press and application motion ​

Native Button, interactive Card/ListItem and Switch label feedback multiply the current application scale through a private Jolt layer. For example, an app scale of 1.1 and a press factor of 0.96 display 1.056. Retargeting the app to 1.2 while held displays 1.152; release, disabling, a theme refresh or disposal removes only the press contribution and leaves 1.2. Each attachment owns its layer, so an old cleanup cannot remove replacement feedback.

When changing scale while feedback or another Jolt layer is active, use Jolt animate(nativeView, { scale: 1.2 }) or set(nativeView, { scale: 1.2 }). Those calls update the application's base inside Jolt's composition. Raw scaleX/scaleY or style writes while a layer is active bypass that base and are not a supported way to retarget it. Direct assignments before a press or after release has settled remain intact when feedback is removed.

The integration now uses Jolt 0.1.0-rc.22. An experimental surface reference demonstrates one application animation in both renderers. It is not a stable API or a physical-device performance guarantee.

Review and migration notes ​

The #19 review removed duplicated prop/type declarations, typed Reveal's existing layout options and made Screen's column sizing explicit in both renderers. It also corrected floating point and partial-final-step Slider behavior.

If you used dimensions such as width="240px", use :width="240". Keep renderer-specific units in platform styles. Negative/non-finite geometry now fails consistently rather than relying on platform coercion. System appearance is implemented; new frameworks remain planned. SSR uses an explicit initial theme snapshot as described in the Nuxt guide.

The focus session exercises the nine initial components in one shared screen. This consumer exercise exposed the missing Reveal layout types and a wrapper that forwarded dimensions without declaring them. Template checks now cover the shared catalog, direct imports and global component names. Behavioral conformance tests cover both renderers; browser tests and native checks cover the actual screen. These checks do not replace a full accessibility or physical-device audit.

Icon renders one Lucide glyph from the bundled font; it is decorative unless label names it, and it never consumes a slot. Input uses a string model, a visible label and explicit focus/submit events. Its id identifies the editor; class, style, width, grow and shrink apply to the whole field. See the Input contract and the profile screen.

Components for NativeScript and Web. Starting with Vue.