Expo UI and Router for iOSExpo SDK 57 and later, iOS only
Components

AccessoryWidgetBackground

A SwiftUI adaptive background view that provides a standard appearance based on the widget's environment.

Expo UI AccessoryWidgetBackground matches the official SwiftUI AccessoryWidgetBackground API and creates an adaptive background view that provides a standard appearance based on the widget's environment.

Usage

Basic accessory widget background

import {
  AccessoryWidgetBackground,
  VStack,
  Text,
  ZStack,
} from '@expo/ui/swift-ui';

export default function BasicAccessoryWidgetBackground() {
  return (
    <ZStack>
      <AccessoryWidgetBackground />
      <VStack>
        <Text>MON</Text>
      </VStack>
    </ZStack>
  );
}

API

import { AccessoryWidgetBackground } from '@expo/ui/swift-ui';

Component

AccessoryWidgetBackground

Type: React.Element<AccessoryWidgetBackgroundProps>

AccessoryWidgetBackgroundProps

Inherited props

Modifiers

Use these modifiers in the modifiers prop of the SwiftUI version.

Expo UI lets you put any of the 89 modifiers for any view on AccessoryWidgetBackground, but not all of them do something here.

  • 45 change what you see on AccessoryWidgetBackground.
  • 31 have no visible effect on AccessoryWidgetBackground.
  • 13 work only in one place, such as a widget or a Grid.

Best modifiers for AccessoryWidgetBackground

These modifiers are the ones that you use most with AccessoryWidgetBackground.

Also works on AccessoryWidgetBackground

AccessoryWidgetBackground takes these modifiers too, and each one works in the usual way.

No visible effect on AccessoryWidgetBackground

AccessoryWidgetBackground accepts these modifiers, but you see no change. They do not give an error.

ModifierWhy nothing happens
accessibilityElementIt joins the child views into one accessibility element, and AccessoryWidgetBackground takes no child views.
allowsTighteningIt changes only text, and AccessoryWidgetBackground shows no text.
boldIt changes only text and SF Symbols, and AccessoryWidgetBackground shows neither.
containerShapeIt sets the shape that the child views use for containerRelativeShape, and AccessoryWidgetBackground takes no child views.
contentShapeIt changes the area that gets touches, and AccessoryWidgetBackground gets no touches of its own.
contentTransition iOS 16+It changes how text and SF Symbols animate when their content changes, and AccessoryWidgetBackground shows neither.
disabledIt turns off the controls in the view, and AccessoryWidgetBackground has none.
dynamicTypeSizeIt changes only text and SF Symbols, and AccessoryWidgetBackground shows neither.
fontIt changes only text and SF Symbols, and AccessoryWidgetBackground shows neither.
geometryGroup iOS 17+It works on the child views that you give the component, and AccessoryWidgetBackground takes none.
imageScaleIt changes only SF Symbols, and AccessoryWidgetBackground shows none.
italicIt changes only text, and AccessoryWidgetBackground shows no text.
kerningIt changes only text, and AccessoryWidgetBackground shows no text.
layoutPriorityIt has an effect only when the view shares an axis with other views in a stack.
lineHeight iOS 26+It changes only text, and AccessoryWidgetBackground shows no text.
lineLimitIt changes only text, and AccessoryWidgetBackground shows no text.
lineSpacingIt changes only text, and AccessoryWidgetBackground shows no text.
minimumScaleFactorIt changes only text, and AccessoryWidgetBackground shows no text.
monospacedDigitIt changes only text, and AccessoryWidgetBackground shows no text.
multilineTextAlignmentIt changes only text, and AccessoryWidgetBackground shows no text.
onAppearIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.
onDisappearIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.
onGeometryChangeIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.
onLongPressGestureIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.
onTapGestureIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.
strikethroughIt changes only text, and AccessoryWidgetBackground shows no text.
textCaseIt changes only text, and AccessoryWidgetBackground shows no text.
tintIt changes the accent colour of controls and SF Symbols, and AccessoryWidgetBackground shows neither.
truncationModeIt changes only text, and AccessoryWidgetBackground shows no text.
underlineIt changes only text, and AccessoryWidgetBackground shows no text.
zIndexIt changes the order of views that cover each other in the same parent, and AccessoryWidgetBackground does not stack its children.

Only in some places

These modifiers work only in a widget, in a Grid, in a Namespace or in a parent that asks for them.

ModifierWhere it works
activityBackgroundTintWorks only in a Live Activity. It has no effect in the app.
alignmentGuideHas an effect only when the parent, such as a VStack or ZStack, aligns its children by the same guide.
containerBackgroundWorks only in a widget, or in a navigation container when you use a navigation placement.
glassEffectIdWorks only on a view that also has glassEffect, in a GlassEffectContainer and a Namespace.
gridCellAnchor iOS 16+Works only on a cell of a Grid. Grid is in @expo/ui/swift-ui, but it has no Expo docs page.
gridCellColumnsWorks only on a view in a Grid.Row. Grid is in @expo/ui/swift-ui, but it has no Expo docs page.
gridCellUnsizedAxesWorks only on a view in a Grid. Grid is in @expo/ui/swift-ui, but it has no Expo docs page.
gridColumnAlignment iOS 16+Works only on a view in a Grid.Row. Grid is in @expo/ui/swift-ui, but it has no Expo docs page.
invalidatableContent iOS 17+Has an effect only when a parent view uses redacted with the invalidated reason.
matchedGeometryEffectWorks only in a Namespace. Give two views the same id and change between them with an animation.
privacySensitiveHas an effect only when a parent view uses redacted with the privacy reason.
unredactedHas an effect only in a parent view that uses redacted.
widgetURLWorks only in a widget. It has no effect in the app.

Sources

The original Expo docs for this page:

On this page