[ Data Display ]

Orb

A glossy round icon: a tinted ball with an inner disc that holds the icon, and a soft colored glow. Use it for task states, quick actions and status markers. With onClick it becomes a real button.

3 examplesDark modeAccessible

Import#

import { Orb } from 'reusify-ui';

When to use#

  • Showing the state of a row (planned, in progress, done) in task lists and feeds.
  • A round "add" or quick-action button that should feel tactile. Use color="neutral" for the grey look.
  • For square app icons and logos, use IconTile instead.

Examples#

Colors#

Any semantic color or CSS color. Tints are mixed with the surface color, so they follow light and dark mode.

<Orb color="primary"><FiCheck /></Orb>
<Orb color="success"><FiCheckCircle /></Orb>
<Orb color="warning"><FiPlay /></Orb>
<Orb color="#ec4899"><FiZap /></Orb>
<Orb color="neutral"><FiPlus /></Orb>

Sizes & glow#

size is in pixels; the icon scales with it. glow={false} removes the colored shadow.

<Orb size={32}><FiCheck /></Orb>
<Orb size={44}><FiCheck /></Orb>
<Orb size={64}><FiCheck /></Orb>
<Orb size={44} glow={false}><FiCheck /></Orb>

As a button, with pulse#

onClick renders a <button>; give it a label for screen readers. pulse adds a ring that grows and fades, good for "in progress".

Planned (click the orb)
const states = [
  { color: 'info', icon: <FiClock />, label: 'Planned' },
  { color: 'warning', icon: <FiPlay />, label: 'In progress' },
  { color: 'success', icon: <FiCheckCircle />, label: 'In review' },
  { color: 'primary', icon: <FiCheck />, label: 'Done' },
];
const [i, setI] = useState(0);

<Orb
  color={states[i].color}
  pulse={i === 1}
  onClick={() => setI((i + 1) % states.length)}
  label={`Status: ${states[i].label}. Click to advance`}
>
  {states[i].icon}
</Orb>

Used in designs#

Orb in real layouts: this design uses it. Open one to try it and copy the code.

API reference#

<Orb />

Forwards its ref. Other props go on the element (a <button> when onClick or as="button").

color'primary'
'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | CSS color | 'neutral'

Tint of the ball, disc, icon and glow.

size44
number

Diameter in px; the icon is about a third of it.

glowtrue
boolean

Colored shadow under the orb.

pulsefalse
boolean

A repeating ring that grows and fades out.

label-
string

Accessible name. Without it a non-button orb is decorative (aria-hidden).

onClick-
(event) => void

Renders a button.

as-
ElementType

Element to render, e.g. "button" or "a".

children-
ReactNode

The icon.

Accessibility#

  • Decorative by default (aria-hidden). Pass label to expose it as an image, or use onClick to make it a focusable button named by label.
  • Button orbs have a visible focus ring in their own color.
  • The pulse animation stops when the user prefers reduced motion.