@cat5th/vue-rn is a custom renderer for Vue 3 that lets developers build React Native apps using familiar Vue APIs and .vue single-file components instead of React or JSX.

Stars

4

7-day growth

No data

Forks

0

Open issues

0

License

No data

Last updated

2026-07-31

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It adapts Vue 3's development model to React Native's native Fabric renderer, offering .vue SFC support, HMR, Vue Router integration, CSS utility parsing, and an experimental web compatibility layer.

Who it is for

  • Vue 3 developers who want to build native mobile apps without learning React
  • Teams seeking to reuse Vue knowledge across web and React Native
  • Developers interested in custom renderers and native UI with Vue
  • React Native teams evaluating a Vue-based alternative authoring layer

Use cases

  • Building iOS and Android apps with Vue 3 and .vue components
  • Creating native mobile apps with Vue Router and reactive state management
  • Using Tailwind CSS or UnoCSS utility classes to style React Native components
  • Experimenting with running the same component set in a browser via the web compatibility layer

Strengths

  • Uses Vue 3's createApp, script setup, ref/reactive APIs, eliminating the need for React components or JSX
  • Renders to React Native Fabric native nodes through @rasenjs/rn-dom
  • Metro integration adds .vue SFC transformation and HMR with component state preservation
  • Built-in support for Vue Router, CSS utility class parsing, and CSS Modules

Considerations

  • Web compatibility support is experimental
  • Relies on @rasenjs/rn-dom and the React Native Fabric environment
  • Requires Metro configuration and a .vue type declaration for TypeScript projects

README quick start

@cat5th/vue-rn

用 Vue 3 写 React Native 应用。

@cat5th/vue-rn 是 Vue 3 的自定义渲染器,将 Vue 渲染到 React Native Fabric。 无需 React 组件、JSX 或学习新的 API——用熟悉的 createApp、``、ref 即可。


特性

  • Vue 3 自定义渲染器 — 用熟悉的 createApp、``、ref/reactive 编写 RN 应用
  • React Native Fabric 原生渲染 — 通过 @rasenjs/rn-dom 直接操作 RN 原生节点
  • Vue Router 集成 — 内置 RouterLink 组件和 RN 适用的内存路由历史 createRNHistory()
  • .vue SFC 转换 — 一行 Metro 配置(withVueRN 插件),直接使用 .vue 文件
  • HMR 热更新 — 修改 .vue 文件自动热替换,组件状态保持不丢失
  • CSS 工具类支持 — 内置 Tailwind CSS v3/v4、UnoCSS 的 class-to-style 解析器
  • CSS Modules — 支持 `` 转换为 RN style 对象
  • Web 兼容层 — 同一套组件可运行在浏览器(实验性)

⚡ 快速开始

完整步骤见 入门指南。以下是一个可运行的最小闭环。

1. 安装

npm install @cat5th/vue-rn @rasenjs/rn-dom vue vue-router

2. 配置 Metro

// metro.config.js
const { getDefaultConfig } = require('@react-native/metro-config')
const { withVueRN } = require('@cat5th/vue-rn/metro')

module.exports = withVueRN(getDefaultConfig(__dirname))

3. 添加类型声明

// env.d.ts
declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  const component: DefineComponent, Record, unknown>
  export default component
}

RN 组件类型自动注册,无需手动引用 tags.d.ts

4. 创建入口

// index.ts
import { createApp } from '@cat5th/vue-rn'
import App from './App.vue'
import { name as appName } from './app.json'

createApp(App).register(appName)

5. 第一个组件



  
    
      Hello from Vue 3 + RN!
    
  

6. 运行

npx react-native run-ios
# 或
npx react-native run-android

文档

文档说明
📖 入门指南环境要求、完整安装与项目配置步骤
� 组件内置组件、事件与类型说明
�🧭 路由集成vue-router 集成与 RouterLink 组件
🔧 Metro TransformerwithVueRN 插件、CSS 工具类与 HMR
📱 Native 渲染渲染器原理与 createApp / register
🌐 Web 兼容层同一套组件运行在浏览器(实验性)
📚 API 参考完整的 API 文档

Description

Vue 3 custom renderer for React Native Fabric

Related repositories

Similar projects matched by category, topics, and programming language.

makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958
uzairansaruzi
Featured
uzairansaruzi GitHub avatar

hermex

Hermex is a native SwiftUI iPhone app that lets you control a self-hosted Hermes AI agent directly from your phone, with no subscriptions, tracking, or third-party relay.

AI & Machine LearningLarge Language Models
941
TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861