OptionItem
Pre-alphaThe registry and the CLI are not published yet.Roadmap

OptionItem

Selectable row built on Item.

Settings

Language

App language
EnglishEnglish
FrançaisFrench
日本語Japanese
KiswahiliComing soon
Region
Format

United Kingdom

Installation

npx axiom add option-item
pnpm dlx axiom add option-item
yarn dlx axiom add option-item
bun x axiom add option-item

Also copies: item, radio, checkbox.

Requires the check and chevron-right icons in your icon registry. The radio and checkbox indicators are RadioIndicator and CheckboxIndicator, so they match the standalone controls.

Usage

import { OptionItem } from "@/components/ui/option-item";

<OptionItem
	label="English"
	selected={lang === "en"}
	onPress={() => setLang("en")}
/>;

Props

OptionItem is an Item with a preset layout, so it also accepts size, divider, disabled and style.

PropTypeDefaultDescription
labelstringMain text of the row.
descriptionstringSecondary text under the label.
iconIconNameLeading icon on a colored tile, like iOS settings. For an avatar or custom media, compose an Item.
iconColorPaletteHue'gray'Tile color from the palette: blue, green, orange
selectedbooleanfalseShows the selection indicator and sets accessibilityState.selected.
indicator'check' | 'radio' | 'checkbox' | 'none''check'How selected is drawn: a trailing check (iOS), a leading radio, a leading checkbox.
valueReactNodeCurrent value shown on the right in content.muted, for rows that open a picker.
trailingReactNodeReplaces the indicator: a Switch, a Badge
chevronbooleanfalseAdds a chevron, for rows that navigate.
destructivebooleanfalseLabel in feedback.error, for “Sign out” or “Delete account”.
onPress() => voidCalled when the row is pressed.

Use cases

Single choice list

The iOS pattern: the checkmark moves to the row the user pressed.

Sort by

Most relevant
Newest
Price: low to high
Price: high to low
{
	sorts.map((s) => (
		<OptionItem
			key={s.value}
			label={s.label}
			selected={sort === s.value}
			onPress={() => setSort(s.value)}
		/>
	));
}

Settings screen

Icon tiles, values, switches and a destructive row on the same screen, all with one component.

Low power mode
Language

English

Notifications

3

Sign out

<OptionItem icon="bolt" iconColor="orange" label="Low power mode" trailing={<Switch value={low} onValueChange={setLow} />} />
<OptionItem icon="globe" iconColor="blue" label="Language" value="English" chevron onPress={openLanguage} />
<OptionItem label="Sign out" destructive onPress={confirmSignOut} />

Multiple selection

indicator="checkbox" for lists where several rows can be on.

Cancel

Share with

Send

AL

Ada Lovelace

CB

Charles Babbage

JV

John von Neumann
<OptionItem
	indicator="checkbox"
	icon={<Avatar size="sm" source={c.photo} fallback={c.initials} />}
	label={c.name}
	selected={recipients.has(c.id)}
	onPress={() => toggleRecipient(c.id)}
/>