HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Flipboard
react-canvas
JavaScript2015–2024
Flipboard / react-canvas

react-canvas

High performance <canvas> rendering for React components

22Distinct people
30Mentions
0Explicit recommenders
13.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

High performance <canvas> rendering for React components

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 6:01:08 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year30 dated mentions

Observed mentions: 2015-02-10 19:05:01 UTC to 2024-04-14 19:36:42 UTC.

0510152015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 15 mentions; 1 submissions, 14 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC15114
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC312
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
react-canvas Introductory blog post React Canvas adds the ability for React components to render to <canvas> rather than DOM. This project is a work-in-progress. Though much of the code is in production on flipboard.com, the React canvas bindings are relatively new and the API is subject to change. Motivation Having a long history of building interfaces geared toward mobile devices, we found that the reason mobile web apps feel slow when compared to native apps is the DOM. CSS animations and transitions are the fastest path to smooth animations on the web, but they have several limitations. React Canvas leverages the fact that most modern mobile browsers now have hardware accelerated canvas. While there have been other attempts to bind canvas drawing APIs to React, they are more focused on visualizations and games. Where React Canvas differs is in the focus on building application user interfaces. The fact that it renders to canvas is an implementation detail. React Canvas brings some of the APIs web developers are familiar with and blends them with a high performance drawing engine. Installation React Canvas is available through npm: npm install react-canvas React Canvas Components React Canvas provides a set of standard React components that abstract the underlying rendering implementation. <Surface> Surface is the top-level component. Think of it as a drawing canvas in which you can place other components. <Layer> Layer is the the base component by which other components build upon. Common styles and properties such as top, width, left, height, backgroundColor and zIndex are expressed at this level. <Group> Group is a container component. Because React enforces that all components return a single component in render(), Groups can be useful for parenting a set of child components. The Group is also an important component for optimizing scrolling performance, as it allows the rendering engine to cache expensive drawing operations. <Text> Text is a flexible component that supports multi-line truncation, something which has historically been difficult and very expensive to do in DOM. <Image> Image is exactly what you think it is. However, it adds the ability to hide an image until it is fully loaded and optionally fade it in on load. <Gradient> Gradient can be used to set the background of a group or surface. render() { ... return ( <Group style={this.getStyle()}> <Gradient style={this.getGradientStyle()} colorStops={this.getGradientColors()} /> </Group> ); } getGradientColors(){ return [ { color: "transparent", position: 0 }, { color: "#000", position: 1 } ] } <ListView> ListView is a touch scrolling container that renders a list of elements in a column. Think of it like UITableView for the web. It leverages many of the same optimizations that make table views on iOS and list views on Android fast. Events React Canvas components support the same event model as normal React components. However, not all event types are currently supported. For a full list of supported events see EventTypes. Building Components Here is a very simple component that renders text below an image: var React = require('react'); var ReactCanvas = require('react-canvas'); var Surface = ReactCanvas.Surface; var Image = ReactCanvas.Image; var Text = ReactCanvas.Text; var MyComponent = React.createClass({ render: function () { var surfaceWidth = window.innerWidth; var surfaceHeight = window.innerHeight; var imageStyle = this.getImageStyle(); var textStyle = this.getTextStyle(); return ( <Surface width={surfaceWidth} height={surfaceHeight} left={0} top={0}> <Image style={imageStyle} src='...' /> <Text style={textStyle}> Here is some text below an image. </Text> </Surface> ); }, getImageHeight: function () { return Math.round(window.innerHeight / 2); }, getImageStyle: function () { return { top: 0, left: 0, width: window.innerWidth, height: this.getImageHeight() }; }, getTextStyle: function () { return { top: this.getImageHeight() + 10, left: 0, width: window.innerWidth, height: 20, lineHeight: 20, fontSize: 12 }; } }); ListView Many mobile interfaces involve an infinitely long scrolling list of items. React Canvas provides the ListView component to do just that. Because ListView virtualizes elements outside of the viewport, passing children to it is different than a normal React component where children are declared in render(). The numberOfItemsGetter, itemHeightGetter and itemGetter props are all required. var ListView = ReactCanvas.ListView; var MyScrollingListView = React.createClass({ render: function () { return ( <ListView numberOfItemsGetter={this.getNumberOfItems} itemHeightGetter={this.getItemHeight} itemGetter={this.renderItem} /> ); }, getNumberOfItems: function () { // Return the total number of items in the list }, getItemHeight: function () { // Return the height of a single item }, renderItem: function (index) { // Render the item at the given index, usually a <Group> }, }); See the timeline example for a more complete example. Currently, ListView requires that each item is of the same height. Future versions will support variable height items. Text sizing React Canvas provides the measureText function for computing text metrics. The Page component in the timeline example contains an example of using measureText to achieve precise multi-line ellipsized text. Custom fonts are not currently supported but will be added in a future version. css-layout There is experimental support for using css-layout to style React Canvas components. This is a more expressive way of defining styles for a component using standard CSS styles and flexbox. Future versions may not support css-layout out of th
Read the full README on GitHub

What Hacker News says

2 sources
I tried submitting a reddit thread (https://www.reddit.com/r/reactjs/comments/474odi/what_about_...), but it didn't get much traction... I think because the videos got pulled. I hope you guys don't mind if I ask this question here, and I apologize if I'm being naive in some way: Aditya Punjani's later Flipkart talk (https://youtu.be/m2tvYGCdOzs) mentioned the importance of mobile web apps and 60 FPS. Ben Alpert's talk mentioned (https://youtu.be/-RJf2jYzs8A?t=1378) "React Native for the web" would be awesome. There was even a lightning talk on react-native-web which attempts to do this using the traditional DOM (https://www.youtube.com/watch?v=RBg2_uQE4KM) Whatever happened to Flipboard's React Canvas (http://engineering.flipboard.com/2015/02/mobile-web/ and https://github.com/Flipboard/react-canvas) being a solution to these problems? Th
Read the rest
ere's pretty good browser availability and although there's currently no perfect solutions for things like accessibility, SEO, or server-side rendering... I failed to se a real "nail in the coffin". Did it just never gather enough momentum?
In React.js Conf 2016 [videos]

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.