expo-divkit
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

expo-divkit

Divkit render library for react-native expo

Installation in managed Expo projects

expo install expo-divkit

How to use

import { ScrollView } from "react-native"
import { ExpoDivKitView } from "expo-divkit"

const jsonPage = {
  "templates": {
    "title": {
      "type": "text",
      "font_size": 20,
      "line_height": 24,
      "font_weight": "bold",
      "paddings": {
        "left": 24,
        "right": 24,
        "bottom": 16
      }
    },
  },
  "card": {
    "log_id": "sample_card",
    "states": [{
      "state_id": 0,
      "div": {
        "type": "container",
        "orientation": "vertical",
        "margins": {
          "top": 24,
          "bottom": 24
        },
        "items": [{
          "type": "title",
          "text": "Hello world",
        }]
      }
    }]
  }
}

function App() {
    return <ScrollView>
       <ExpoDivKitView json={jsonPage} />
    </ScrollView>
}

Package Sidebar

Install

npm i expo-divkit

Weekly Downloads

63

Version

0.4.0

License

MIT

Unpacked Size

70.4 kB

Total Files

62

Last publish

Collaborators

  • rpulatov