Getting started
Version 0.1.0-rc.21 is a prerelease for trying Mavis in real apps. The API can change between prerelease versions. Code and documentation use the MIT license.
NativeScript desktop · RC.19
The RC.19 creator uses NativeScript AppKit for Mac and XAML for Windows through the new @getcortexlabs/mavis-desktop package, with 99 components in experimental form. Native desktop setup · Desktop components.
Create a project
npx @getcortexlabs/create-mavis@latestChoose Web, iOS/Android, Mac and Windows through the creator catalog. Web/desktop use Vue; the five direct native frameworks are separate iOS/Android presets.
Install in your app
In an existing NativeScript-Vue app using Core 9.1.4 and NativeScript-Vue 3.1.3:
npm install @getcortexlabs/mavis@0.1.0-rc.21 @rafaelaugusto/jolt@0.1.0-rc.22Jolt is required. The core package is installed as a Mavis dependency. Android adapter changes require a native build; when upgrading an existing app, run ns clean if metadata from an earlier version remains.
In a Vue Web app using Vue 3.5.42:
npm install @getcortexlabs/mavis-web@0.1.0-rc.21 @rafaelaugusto/jolt@0.1.0-rc.22Import @getcortexlabs/mavis-web/style.css in the app entry. It requires Jolt 0.1.0-rc.22 or newer, without native SDKs; see motion.
The npm tags rc and latest target 0.1.0-rc.21 after publication. Keep the exact version while testing. Deep native layouts can still be slow (#56). VoiceOver may skip a newly inserted offscreen status (#54). Device and keyboard coverage is incomplete. Read the release notes before adopting the release candidate.
The catalog opens on individual components; complete examples live in Showcase. To contribute or run the catalog from source, follow the steps below.
Run on the Web
With Node 22 or later:
git clone https://github.com/getcortexlabs/mavis-ui.git
cd mavis-ui
npm ci
npm run build
npm run web:devOpen /playground/ at the URL printed by Vite. You can also open the published catalog ↗
Run on NativeScript
With a configured NativeScript environment, after installing and building the packages at the root:
cd examples/catalog
npm ci
npm run android
# On macOS with Xcode:
npm run iosThe app explicitly installs NativeScript-Vue, Jolt and vue-router-ns. Jolt is required by the NativeScript package. After changing library packages, run npm run build at the root and restart the app.
Register components
import { createMavis } from '@getcortexlabs/mavis/vue'
import { midnight } from '@getcortexlabs/mavis'
app.use(createMavis({ theme: midnight }))import { createMavis } from '@getcortexlabs/mavis-web'
import { midnight } from '@getcortexlabs/mavis-web'
import '@getcortexlabs/mavis-web/style.css'
app.use(createMavis({ theme: midnight }))app is the Vue application created for your target platform. On NativeScript, a Screen needs a navigation host such as RouterView. The catalog includes complete startup code for both environments.
For a native screen without a router, the minimal entry is:
import { createApp, h } from 'nativescript-vue'
import { createMavis } from '@getcortexlabs/mavis/vue'
import App from './App.vue'
// App.vue has one MScreen at its root.
createApp({ render: () => h('Frame', {}, [h(App)]) })
.use(createMavis())
.start()Components are registered as MButton, MRow and so on; Vue also accepts m-button and m-row. Individual imports are available too. With @nativescript/vite, write MButton and MRow: its Vue compiler treats hyphenated tags as native elements unless your vite.config.mts changes isCustomElement. Both @nativescript/webpack and @nativescript/vite pick up the Mavis iOS and Android files.
Build your first composition
<m-screen scroll>
<m-column padding="lg" gap="md">
<m-text as="h1" variant="title">Your space.</m-text>
<m-card gap="md">
<m-text>Ready when you are.</m-text>
<m-button @click="save">Save</m-button>
</m-card>
</m-column>
</m-screen>save belongs to your application. Continue with the component catalog, customize themes, or see components in the Showcase.
For local component imports and selective Web icons, see modular installation.
Adding platforms and shared platform differences
See Add a platform for the RC.12 APIs: --add-native/--add-web, MPlatform, list layout motion, section-relative scroll and navigation transitions.
For React, Angular, Svelte, Solid or JS/TS on NativeScript, see the direct adapter guide. Its six-component coverage and versions are separate from the Vue catalog above.