Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.24 KB

README.md

File metadata and controls

63 lines (44 loc) · 1.24 KB

Learn once, write anywhere:
React Renderer to build UI interfaces using Lightning 3 Renderer

DISCLAIMER: In experimental stage

React Lightning is a react renderer to build UI interfaces using Lightningjs. It's mainly a renderer focused on creating things for Smart TV, Android TV, PS5 and low memory devices.

📖 Documentation

Coming Soon

Demo App

Coming Soon

🚀 API Usage

Install it using your favorite package manager

# NPM
npm install react-lightning

# Yarn
yarn add react-lightning

# PNPM
pnpm add react-lightning

React Lightning Hello World example

import { init, render } from 'react-lightning';

const rootElement = document.getElementById('app')

const appWidth = 1280
const appHeight = 720
const defaultResolution = window.innerHeight
const logicalPixelRatio = defaultResolution / appHeight;

const config = {
  appWidth,
  appHeight,
  deviceLogicalPixelRatio: logicalPixelRatio,
}

init(rootElement, config).then(() => render(() => {
  <ln-view width={500} height={500} color={0x0000ffff}>
    <ln-text>Hello World</tv-text>
  </ln-view>
}))