svelte-native

Svelte controlling native components via Nativescript

  • 所有者: halfnelson/svelte-native
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    1
      比較:

Github星跟蹤圖

Svelte Native

Create Mobile applications using native widgets via Svelte Svelte and NativeScript.

See https://svelte-native.technology for docs and tutorials

todo in svelte-native

Features

Svelte-Native includes Svelte specific integrations such as

  • The ability to use svelte components to create native applications on top of NativeScript core
  • Svelte specific navigation and modals eg navigate({ page: MySvelteComponent })
  • Integration with svelte's transistions eg <label transition:fade="{duration: 2000}">
  • Integration with sveltes scoped styles
  • Complete coverage of the Nativescript core UI modules
  • Uses unmodified Svelte and Nativescript modules

Work In Progress

While Svelte Native is feature complete, there are some items outstanding to bring it to the level of other Nativescript library integrations

  • At least 1 emoji in readme.md :+1:
  • More Tests ? #54

Installation

You can get started developing with this using the latest template

$ npm install -g nativescript
$ tns create myapp --template tns-template-blank-svelte

A fresh Svelte Native app will be found in the myapp folder

Once installed use the tns preview, tns build or tns run commands as for a normal NativeScript application.

Usage

App.svelte

<page>
    <actionBar title="Svelte Native"></actionBar>
    <stackLayout>
        <label text={msg}></label>
        <button text="Change" on:tap="{toggle}"></button>
    </stackLayout>
</page>

<script>
  export let msg = 'Hello World!'
  const toggle = () => {
      msg = "Hi from svelte"
  }
</script>

Main.ts

import App from './components/App.svelte';

import { svelteNative } from 'svelte-native'

svelteNative(App, {msg: "Hi from launcher"});

Examples

Svelte Native HackerNews

Simple HackerNews client in Svelte Native.

See https://github.com/halfnelson/svelte-native-hackernews for the repo.

HackerNews Example Image

Svelte Native Grocery

Grocery app example in Svelte Native.

See https://github.com/halfnelson/svelte-native-grocery for the repo.

Grocery Example Image

Svelte Native Realworld

Realworld implementation app in Svelte Native.

See https://github.com/halfnelson/svelte-native-realworld for the repo.

Realworld Example Image

Credits

The DOM implementation is based on the one from Nativescript-Vue. Thanks!
The API Docs were ported from the Nativescript-Vue Too
The Site Design is from SvelteJS

主要指標

概覽
名稱與所有者halfnelson/svelte-native
主編程語言TypeScript
編程語言JavaScript (語言數: 7)
平台
許可證MIT License
所有者活动
創建於2019-01-31 14:19:35
推送於2025-03-13 22:11:00
最后一次提交2025-03-14 08:00:19
發布數15
最新版本名稱v1.0.6 (發布於 )
第一版名稱v0.1.1 (發布於 2019-02-24 10:48:53)
用户参与
星數1.8k
關注者數27
派生數79
提交數586
已啟用問題?
問題數179
打開的問題數48
拉請求數88
打開的拉請求數0
關閉的拉請求數94
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?