GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alibaba/canvas-ui: UI Renderer runs on top of the HTML5 Canvas

BranchesTags
Open more actions menu

Latest commit

 

History

73 Commits
73 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.husky
.husky
 
 
.vscode
.vscode
 
 
examples/kanban
examples/kanban
 
 
packages
packages
 
 
tools
tools
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
jest-setup.ts
jest-setup.ts
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
rollup.config.js
rollup.config.js
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

canvas-ui-logo

Canvas UI is a general UI renderer runs on HTML Canvas. https://alibaba.github.io/canvas-ui/


It provides a series of React components, allowing developers to quickly build Canvas-based applications using their existing knowledge.

It also features a DOM-like scene tree, enabling developers to manipulate elements drawn in Canvas just like they would manipulate DOM elements.

import React from 'react'
import { Canvas, Text, Flex } from '@canvas-ui/react'

export default () => {
  const containerStyle = {
    width: 250,
    flexDirection: 'column'
  }
  const textStyle = {
    maxWidth: containerStyle.width,
    maxLines: 1,
  }
  return (
    <div style={{ height: '100px' }}>
      <Canvas>
        <Flex style={ containerStyle }>
          <Text style={ textStyle }>私はガラスを食べられます。それは私を傷つけません。</Text>
          <Text style={ textStyle }>The quick brown fox jumps over the lazy dog.</Text>
        </Flex>
      </Canvas>
    </div>
  )
}

Demo

https://stackblitz.com/github/alibaba/canvas-ui/tree/main/examples/kanban

canvas-ui-kanban-demo

Features

  • Manipulate elements in Canvas just like DOM elements

  • Seamlessly integrating with React applications

  • Flex layout

  • Animation based on motion

  • Basic text typography capabilities: automatic word wrapping, alignment, text overflow

  • CSS styles through the style attribute

  • Interaction events: PointerEvents and WheelEvent

  • Convenient layering capabilities

  • Fully written in TypeScript with complete type definitions

  • Rendering in WebWorker (WIP)

Project Structure

  • packages/core The core of the renderer, providing capabilities such as createElement, events, rendering pipeline, etc.

  • packages/react Canvas UI's official React binding, providing components like <View />, <Text />, etc.

  • packages/examples Component development and testing environment based on Storybook

  • tools/ scripts

Development

# Start development mode for core and react
$ pnpm dev

# Start Storybook
$ pnpm dev:storybook

# Run unit tests
$ pnpm test

# Build umd, esm versions
$ pnpm build

About

UI Renderer runs on top of the HTML5 Canvas

alibaba.github.io/canvas-ui/

Topics

canvasreacttypescript

Resources

Readme
MIT license
Activity
Custom properties

Stars

232 stars

Watchers

7 watching

Forks

25 forks
Report repository

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.