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.
| Component | Main defaults | Default slot | Events |
|---|---|---|---|
| Screen | scroll=false | Screen content | None |
| Row | gap=none, align=center, justify=start, wrap=false | Child components | None |
| Column | gap=none, align=stretch, justify=start, wrap=false | Child components | None |
| Box | No padding or radius | Layers in drawing order | None |
| Card | padding=lg, radius=lg, gap=none, interactive=false, disabled=false | Vertical content | click, no payload |
| Text | variant=body, tone=text, as=p, align=left, wrap=true | Text and MSpan | None |
| Icon | size=md, tone=text; name required; label optional | None | None |
| Button | variant=primary, size=md, disabled=false, loading=false | Text only | click, no payload |
| Slider | modelValue=0, min=0, max=100, step=1, disabled=false; label required | None | update:modelValue, number |
| Input | modelValue='', type=text, multiline=false, rows=3; label required | None | update:modelValue and submit, string; focus/blur/action, no payload |
| Reveal | show=false; Column layout defaults | Conditional child components | None |
| Sheet | open=false, dismissible=true, fullscreen=false, padding=lg; title or accessibilityLabel required | Sheet content | update: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
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
id | string | — | — |
accessibilityLabel | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
padding | string | number | — | token: space, units: layout |
paddingX | string | number | — | token: space, units: layout |
paddingY | string | number | — | token: space, units: layout |
radius | string | number | — | token: radius, units: layout |
width | number | string | — | units: dimension |
height | number | string | — | units: dimension |
backgroundColor | string | — | — |
borderWidth | number | — | units: layout |
borderColor | string | — | — |
motionSurface | object | — | runtime only |
motionRegion | object | — | runtime only |
perspective | number | — | — |
sharedTag | string | — | — |
MRow
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
id | string | — | — |
accessibilityLabel | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
padding | string | number | — | token: space, units: layout |
paddingX | string | number | — | token: space, units: layout |
paddingY | string | number | — | token: space, units: layout |
radius | string | number | — | token: radius, units: layout |
width | number | string | — | units: dimension |
height | number | string | — | units: dimension |
backgroundColor | string | — | — |
gap | string | number | — | token: space, units: layout |
justify | start | center | end | between | around | "start" | — |
wrap | boolean | false | — |
motionRegion | object | — | runtime only |
align | start | center | end | stretch | "center" | — |
MColumn
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
id | string | — | — |
accessibilityLabel | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
padding | string | number | — | token: space, units: layout |
paddingX | string | number | — | token: space, units: layout |
paddingY | string | number | — | token: space, units: layout |
radius | string | number | — | token: radius, units: layout |
width | number | string | — | units: dimension |
height | number | string | — | units: dimension |
backgroundColor | string | — | — |
gap | string | number | — | token: space, units: layout |
justify | start | center | end | between | around | "start" | — |
wrap | boolean | false | — |
motionRegion | object | — | runtime only |
align | start | center | end | stretch | "stretch" | — |
MText
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
motionSurface | object | — | runtime only |
weight | string | — | token: fontWeight |
id | string | — | — |
accessibilityLabel | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
text | string | — | — |
as | p | span | h1 | h2 | h3 | h4 | h5 | h6 | "p" | — |
variant | display | title | heading | body | caption | overline | "body" | — |
tone | background | surface | elevated | text | muted | primary | onPrimary | primarySoft | accent | onAccent | accentSoft | border | warning | success | danger | "text" | token: palette |
align | left | center | right | "left" | — |
wrap | boolean | true | — |
maxLines | number | — | — |
MButton
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
href | string | — | — |
target | _self | _blank | "_self" | — |
rel | string | — | — |
navigate | function | — | runtime only |
reorderHandle | boolean | false | — |
motionSurface | object | — | runtime only |
id | string | — | — |
accessibilityLabel | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
text | string | — | — |
type | button | submit | reset | "button" | — |
name | string | — | — |
value | string | — | — |
form | string | — | — |
variant | primary | secondary | ghost | "primary" | — |
size | sm | md | lg | "md" | — |
disabled | boolean | false | — |
loading | boolean | false | — |
loadingIndicator | none | dots | bars | ring | "none" | — |
loadingText | string | "Loading…" | — |
icon | string | — | token: icon |
trailingIcon | string | — | token: icon |
MInput
| Prop | Kind / values | Default | Constraints |
|---|---|---|---|
id | string | — | — |
accessibilityHidden | boolean | — | — |
grow | number | 0 | — |
shrink | number | — | — |
width | number | string | — | units: dimension |
modelValue | string | "" | — |
label | string | — | required |
floatingLabel | boolean | false | — |
placeholder | string | "" | — |
helperText | string | "" | — |
error | string | "" | — |
type | text | email | password | tel | url | search | "text" | — |
name | string | — | — |
autocomplete | string | — | — |
required | boolean | false | — |
inputmode | string | — | — |
form | string | — | — |
disabled | boolean | false | — |
readonly | boolean | false | — |
multiline | boolean | false | — |
rows | number | 3 | — |
maxLength | number | — | — |
autocapitalize | none | sentences | words | characters | — | — |
autocorrect | boolean | — | — |
returnKey | done | next | go | search | send | "done" | — |
trailingAction | object | — | — |
icon | string | — | token: icon |
trailingIcon | string | — | 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%, orauto. Numbers mean DIPs on native and CSS pixels on Web. Parent constraints determine percentage sizing. growdefaults to 0.shrinkdefaults 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.