Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Thumbs

  • Stable
  • WCAG 2.2 evidence
  • RTL

Thumbs up / thumbs down feedback: a question and two icon buttons; the answer can be cleared. Built on React Aria ToggleButtonGroup with single selection: a radiogroup named by the question, two radios named "Helpful" and "Not helpful" (upLabel, downLabel), arrow keys move between them (mirrored in right-to-left locales), Enter or Space chooses, pressing the chosen thumb again clears it (WCAG 2.1.1, 4.1.2). Buttons are 36 px targets (2.5.8). The chosen thumb is tinted, outlined in brand colour and drawn filled, so the state is not colour-only (1.4.1). Icons are decorative (1.1.1). Consumer duties: question wording, translated labels, a follow-up (for example a Textarea) for nuanced feedback.

import { Thumbs } from "@nexera-ui/react";
Loading example…
3
examples
13
props
2
live controls
1
platform
8
WCAG criteria
1
block uses it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
label
isDisabled
Generated code
import { Thumbs } from "@nexera-ui/react";

<Thumbs />

Examples 2

The same examples as Storybook, rendered live. Open Code to copy one.

Long question

A long question wraps; the thumbs move to the next line in a narrow container.

Loading example…

Right to left

Right-to-left: the question is on the right and arrow keys follow the reading direction. Translate the names.

Loading example…

Props 13

Press "Try it" on a card to load that prop into the playground.

13 props shown

valueNexera
ThumbsValue | null

The answer, or null for none. Controlled; pair it with onChange.

Default –
defaultValueNexera
ThumbsValue | null

The initial answer when uncontrolled.

Default null
onChangeNexera
(value: ThumbsValue | null) => void

Called with the new answer; null when the chosen thumb is pressed again to clear it.

Default –
upLabelNexera
string

Accessible name of the thumb-up button. Translate it.

Default Helpful
downLabelNexera
string

Accessible name of the thumb-down button. Translate it.

Default Not helpful
nameNexera
string

Name of a hidden form field that submits up, down or an empty string.

Default –
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style for the root.

Default –
labelNexera
ReactNode

The question before the thumbs, for example "Was this helpful?". Wraps; names the group.

Default –
aria-labelNexera
string

Accessible name when the question is shown elsewhere. Translate it.

Default –
aria-labelledbyNexera
string

Id(s) of the visible element(s) that hold the question.

Default –
isDisabledReact Aria
boolean

Whether all items are disabled.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

5 direct · 3 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-hovered
  • data-pressed
  • data-selected
Usage
<Thumbs className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components