Skip to Content
ARCUI

Colors API

ARCUI 2.0.0 semantic tones, TThemeColor, component-specific colors, token fallback, and native style ownership.

ARCUI 2.0.0 gives visual components strongly typed, component-specific colors objects. Semantic tone presets cover controls where color communicates meaning. Every instance override is optional: you can change one slot without replacing the other states or theme tokens.

The shared TThemeColor primitive

import type { TThemeColor } from "react-native-arc-ui";

const fixed: TThemeColor = "rgba(0,122,255,1)";

const themeAware: TThemeColor = {
  light: "rgba(0,64,135,1)",
  dark: "rgba(151,204,255,1)",
};
  • A string is fixed across light and dark themes.
  • A complete { light, dark } pair uses ARCUI's animated theme progress.
  • Both keys are required; the public contract deliberately does not accept an incomplete pair.
  • ARCUI's own examples use explicit rgba(...) strings. The consumer API still accepts other valid React Native color strings.

Color resolution

1. An explicitly provided colors slot for this instance
2. The matching semantic tone and visual/interaction state, when available
3. The component's light/dark design tokens

An omitted colors slot leaves the component's existing semantic state intact. For example, overriding a Button's default background does not replace its pressed, disabled, or text colors.

For native style escape hatches that own the same property (such as Text.style.color and ThemedView.style.backgroundColor), a provided colors slot wins. When that slot is absent, the native style retains ownership before ARCUI falls back to tokens.

Semantic tones

ComponentAvailable tone valuesDefault
Buttonprimary, secondary, neutral, dangerprimary
Badgeneutral, info, success, warning, dangerdanger
Toastneutral, info, success, warning, dangerneutral
Infoboxinfo, success, warning, dangerinfo
Dropdown itemneutral, dangerneutral
Dialog actionButton tonesprimary
Tab dot badgeBadge tonesBadge default

tone describes semantics; it does not replace a component's presentation type (Button still supports solid, border, and transparent). Components without a public tone prop continue to resolve colors from their own state/presentation tokens.

<Button tone="danger" type="solid">Remove</Button>

<Badge tone="success" label="Synced" />

<Infobox tone="warning">Changes have not been saved.</Infobox>

Customize just one slot

import { Button, Text, ThemedView } from "react-native-arc-ui";

<Button
  tone="secondary"
  colors={{
    background: {
      default: { light: "rgba(232,242,255,1)", dark: "rgba(18,42,66,1)" },
      pressed: "rgba(196,220,247,1)",
    },
    text: { default: "rgba(0,64,135,1)" },
  }}
>
  Preview
</Button>

<ThemedView colors={{ background: "rgba(20,20,20,1)" }}>
  <Text colors={{ text: "rgba(255,255,255,1)" }}>Fixed colors</Text>
</ThemedView>

Fixed color overrides will not automatically adapt their contrast when the theme changes. When setting backgrounds and text explicitly, ensure adequate contrast in both modes and in disabled/pressed states.

Shared field colors

Input, InputPassword, InputArea, InputNumber, and InputOTP reuse the shared field color contract, with each field exposing the subset relevant to its presentation.

import { Input } from "react-native-arc-ui";

<Input
  value={email}
  onChangeText={setEmail}
  label="Email"
  colors={{
    border: {
      focused: "rgba(0,122,255,1)",
      error: "rgba(211,47,47,1)",
    },
    placeholder: {
      light: "rgba(90,90,90,1)",
      dark: "rgba(170,170,170,1)",
    },
  }}
/>

Field slots include background, border, text, placeholder, label, icon, clearButton, and error. The exact nested states differ by slot; see each component's generated API reference and the public IFieldColors type.

Where to find component slots

Component groupRepresentative colors slots
Buttonbackground.*, border.*, text.*, loading
Badgebackground, text (label badges only)
Text / ThemedView / Screentext, background, background respectively
Icon / SpinnerLoadericon, indicator respectively
Dividerline, label
Checkbox / Radio / Toggle / ChipComponent-specific selection, pressed, disabled, and validation slots
Accordion / Select / DropdownComponent-specific presentation, items, and active/disabled states
Header / TabsSurface, text/icon/control, indicator, and active/inactive slots
Modal / Dialog / Toast / InfoboxBackdrop/surface/content/feedback slots as exposed by each public type
ProgressBar / Slider / SkeletonLoaderTrack/fill/value, tooltip/thumb, base/highlight slots

The table is a discovery map, not a replacement for the exact TypeScript interfaces. These are exported from the package root (for example, IButtonColors, IFieldColors, and ISelectColors). Do not guess nested slot names; use the API table on the relevant component page or the installed package declarations.

Token ownership

For consistent application-wide changes, configure the complete top-level colors token namespace rather than placing the same colors props on many instances. ARCUI token overrides are shallow at the top level:

import { ARCUI, defaultTokens, type TTokensOverride } from "react-native-arc-ui";

const tokens = {
  colors: {
    ...defaultTokens.colors,
    // Replace complete light/dark component token subtrees as required.
  },
} satisfies TTokensOverride;

<ARCUI tokens={tokens}>{children}</ARCUI>;

The old top-level colors.states namespace no longer exists. Semantic defaults now live in component-owned tokens such as colors.light.checkbox.error and colors.dark.checkbox.error.

Migrating from 1.x

The previous color, darkColor, lightColor, Badge text-color, and Tabs background-color prop families were replaced by typed colors slots. Dropdown items use tone="danger" instead of destructive; Infobox uses tone instead of type.

Migration guide → · Theming → · Tokens →

On this page