Radial menu and radial list

A pure CSS library to inline lists and menus around a circle, flexible and customizable.

© 2020 Fabio Vitali (fabio.vitali@unibo.it)

Introduction

A radial layout organizes a list of items in a circle around a central element called pivot. Radial lists always show the items around the pivot, while radial menus use the pivot as a clickable toggle button to show and hide the items. Both lists and menus can be placed inline next to the boxes of other elements and text strings. Both the central pivot and the individual items can contain icons, text and labels, and can be hypertext links.

This is a radial list:
, while a radial menu looks like this: (click on the compass icon to see what happens).

Showcase

Four corners

The chase

Curtains down

Curtains up

Labels

The spiral

Download

The library is composed of a single CSS file, with no dependencies (this documentation uses Font Awesome, but it is not necessary to fully enjoy this library).
The library can be downloaded here:

Documentation

All features of a radial layout are managed through CSS, and several utility classes are available to simplify the set up. Markup elements in most cases can be equivalently DIVs, SPANs or UL/LIs with no loss of functionality. In this documentation I will use DIV mostly, but you can play around with other elements.

Designers can place any content inside the central element (the pivot) and in any of the individual radial items, and can control the position, the size, and the distance of the individual radial items, as well as the speed and delay with which they appear when the central pivot is clicked.

All elements of a radial menu are placed within a DIV with class "radial". A radial list has two required elements inside, while a radial menu has three elements (adding a checkbox input element that toggles the menu).

Radial layout

The radial layout is activated by assigning class radial to a container:

<div class="radial"> ... </div>

List vs. menu

A radial list (all items are always shown) is specified by assigning class list to the radial container. It must only contain the pivot and the list:

<div class="radial list">
		<div class="radialPivot">...</div>
		<div class="radialList" role="navigation" aria-label="menu items"> ... </div>
</div>

A radial menu (items are shown when the pivot is clicked) is specified by by assigning class menu to the radial container. The container must start with a checkbox, and the pivot must be a label associated to the checkbox (through the for attribute).

<div class="radial menu">
		<input type="checkbox" id="someId">
		<label class="radialPivot" for="someId">...</label>
		<div class="radialList" role="navigation" aria-label="menu items"> ... </div>
</div>

Automatic positioning: clock vs. compass

Positioning the list items around a circle is defined by the angle between the vertical axis and the axis connecting the item to the pivot. There are two automatic position systems, called clock (up to 12 positions in clockwise order, called 12, 1, 2, ..., 11) and compass (up to 16 positions in clockwise order, called North, North-northeast, Northeast, East-Northeast, East, ..., North-Northwest). It is not necessary to fill in all available slots, as the automatic positioning will stop after having dealt with all the items in the list. Items are organized automatically in the corresponding position system by assigning class clock or compass to the radialList container:

Complete clock

Partial clock

Complete compass

Partial compass

Manual positioning: helper classes

Positioning items can also be done individually by adding one of the available helper classes.

Boss and employees

The chart

Here

Weird order

Countdown

Dimensional settings

Two settings control the radius of the circle and the overall size of the pivot and of the individual elements.

radius1

radius2

radius3

radius4

radius5

radius6

radius7

radius8

radius9

radius10

size1

size2

size3

size4

size5

size6

size7

size8

size9

Animation

The creation of the circular menu is controlled by an animation that takes care of the speed and the delay of the movement of the list items. There are three families of classes that are involved in the animation:

delay0

delay1

delay2

delay3

delay4

delay5

delay6

delay7

delay8

delay9

delay10

speed0

speed1

speed2

speed3

speed4

speed5

speed6

speed7

speed8

speed9

speed10

Normal order

Reverse order

Even then odd

Odd then even

Top to bottom

Bottom to top

Left to right

Right to left

Quadrants

Random

Additional helpers

To further style the radial menu, a few additional classes are available:

Without displace

With displace

Without icon

With icon

Using clear, clearRight and clearLeft

Suppose you have a sentence within which you place a radial menu, e.g., , but you do not like that it stands in front of the text, so you place another one that clears its space on both sides , one that clears only on its left but not on its right, or viceversa another one that clears on its right but not on its left.