[ 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.
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".
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").
| Prop | Type | Default | Description |
|---|---|---|---|
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | CSS color | 'neutral' | 'primary' | Tint of the ball, disc, icon and glow. |
size | number | 44 | Diameter in px; the icon is about a third of it. |
glow | boolean | true | Colored shadow under the orb. |
pulse | boolean | false | 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. |
color'primary''primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | CSS color | 'neutral'Tint of the ball, disc, icon and glow.
size44numberDiameter in px; the icon is about a third of it.
glowtruebooleanColored shadow under the orb.
pulsefalsebooleanA repeating ring that grows and fades out.
label-stringAccessible name. Without it a non-button orb is decorative (aria-hidden).
onClick-(event) => voidRenders a button.
as-ElementTypeElement to render, e.g. "button" or "a".
children-ReactNodeThe 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.