DEV Community

Cover image for orbital-list 🪐 - My first React Library
Laurent Senta
Laurent Senta

Posted on

orbital-list 🪐 - My first React Library

A while ago I wrote a web application that lets you see your team and coworkers on a circular clock.

Alt Text

This circular interface is the core feature of to me. Time, especially the time of day, goes round and round. It's more natural and more intuitive to represent it on a circle.

This design took me hours and hours to implement. I skipped the data visualization libraries because most of them rely on an abstraction that is data-oriented. It wasn't ideal here.

For example, if I have a list of users, in React you'd go with something like this:

  <li>Tom (GMT, 12:02)</li>
  <li>Martine (UTC-2, 14:02)</li>

// which you write:

  { => <li>{} ({user.timezone} - {user.time}</li>)}
Enter fullscreen mode Exit fullscreen mode

Whereas in libraries such as d3, you have to convert your data into "pie chart data" and setup some sort of rendering engine. Like in this example.

In the end, I wrote a library of components that would let me represent circular interfaces. It generates a "circular context" and position components inside this context.

It looks like having HTML lists displayed as orbits.

    <Dial color='#1f2041' />
    <Orbit color='rgba(244, 205, 205, 1)' radius={0.15} />
        style={{ color: '#ed254e', fontSize: '1.2rem', fontWeight: 'bold' }}
Enter fullscreen mode Exit fullscreen mode

Today I release this as an open-source library. It's small, the code is embarrassing, but you know what they say...

"If you're not embarrassed, you've launched too late."

I'd be happy to hear from you, if the approach makes sense and if you find the demo and library pleasant to use.

The demo is here:

The GitHub repository is here:

Top comments (0)