Skip to content
项目

关于

🧱 移动端优先的堆栈导航框架,配备可组合的插件系统

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+1
1个月
+3

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文
demo

logo logo

Introduction

View full documentation and demo on https://stackflow.so

Stackflow is a project that implements Stack Navigation UX, which is mainly used in mobile devices (iOS/Android, etc.) in a JavaScript environment. So, it can help to easily develop hybrid apps and webviews.

  • Stack screens and keep scrolling state.
  • It supports transition effects that stack up the screen and the transition effect that disappears when you go back.
  • Supports iOS-style swipe back.
  • It passes the necessary parameters to the screen to be switched.

So, what advantages does Stackflow have compared to the existing navigation library?

  • You can only use the state for stacks and transitions separately without UI. You can tear off the UI and use it as you like.
  • You can inject any additional extensions you want between lifecycles through the plugin interface.
  • Since the core logic and integration layers are separated, it can be integrated with various front-end frameworks. (Now only supports React)
  • Because render logic and UI can be injected from the outside, mobile webview and desktop development can be done in one codebase.
  • Server-Side Rendering is supported. (ReactDOMServer.renderToString)

Getting Started

$ yarn add @stackflow/config @stackflow/core @stackflow/react
import ReactDOM from "react-dom";
import { defineConfig } from "@stackflow/config";
import { stackflow } from "@stackflow/react";
import MyActivity from "./MyActivity";

const config = defineConfig({
  activities: [
    {
      name: "MyActivity",
    },
  ],
  initialActivity: () => "MyActivity",
  transitionDuration: 350,
});

const { Stack } = stackflow({
  config,
  components: {
    MyActivity,
  },
  plugins: [],
});

const App = () => {
  return (
    <Stack />
  );
};

ReactDOM.render(<App />, ...)

Integration Examples

To integrate Stackflow with a specific framework with routing capabilities, the framework requires an extension to manually call the preload API. However, Next.js does not officially support the preload API.

Contributors

To contribute new features or options to Stackflow, please check Contribution Guide

License

MIT

探索相关项目

加载中…