Prop
The generated section below is sourced from runtime/types/prop.d.ts.
Generated Type Declarations
Props
ts
type Props = Record<string, unknown>;VStackValue
spacingDefault 0.alignmentHorizontal alignment for child views.
ts
type VStackValue = {
spacing?: number;
alignment?: HorizontalAlignment;
};HStackValue
spacingDefault 0.alignmentVertical alignment for child views.
ts
type HStackValue = {
spacing?: number;
alignment?: VerticalAlignment;
};FlowValue
spacingDefault 0.rowSpacingDefault 0.alignmentVertical alignment for items within each row.rowAlignmentHorizontal alignment for each row when its contents do not fill the available width.
ts
type FlowValue = {
spacing?: number;
rowSpacing?: number;
alignment?: VerticalAlignment;
rowAlignment?: 'leading' | 'center' | 'trailing';
};ZStackValue
alignmentHorizontal and vertical alignment for child views.
ts
type ZStackValue = {
alignment?: Alignment;
};ButtonValue
intentIntent returned byAwait.define(...), used to run a registered widget intent when the button is tapped.fastOnly applies in the app; triggers the button as soon as the touch begins.audioRequests permission to play audio.liveRuns the intent in the app process so it can start or update a live activity from the background.urlOpens a universal link directly, such ashttps://github.com/await-widget/skills.
ts
type ButtonValue = {
intent?: IntentInfo;
fast?: boolean;
audio?: boolean;
live?: boolean;
url?: string;
};ShapeValue
fillDefault black on light theme, white on dark theme.strokeOnly centered strokes are supported.
ts
type ShapeValue = {
fill?: ShapeStyle;
stroke?: {
color?: Color;
lineWidth?: number;
lineCap?: 'butt' | 'round' | 'square';
lineJoin?: 'miter' | 'round' | 'bevel';
miterLimit?: number;
dash?: number[];
dashPhase?: number;
};
shape?: {
trim?: [number, number];
rotation?: RotationEffect;
offset?: Point;
scale?: ScaleEffect;
in?: {
x: number;
y: number;
width: number;
height: number;
};
};
};RoundedRectangleValue
styleDefaultcontinuous.
ts
type RoundedRectangleValue = {
rectRadius?: Dimension;
style?: CornerRadiusStyle;
};UnevenRoundedRectangleValue
ts
type UnevenRoundedRectangleValue = {
rectRadius?: {
topLeft?: Dimension;
topRight?: Dimension;
bottomRight?: Dimension;
bottomLeft?: Dimension;
bottom?: Dimension;
top?: Dimension;
left?: Dimension;
right?: Dimension;
};
style?: CornerRadiusStyle;
};CapsuleValue
ts
type CapsuleValue = {
style?: CornerRadiusStyle;
};SectorValue
ts
type SectorValue = {
value: [start: number, end: number];
};PolygonValue
ts
type PolygonValue = {
value: Array<[x: number, y: number]>;
};LinkValue
ts
type LinkValue = {
url?: string;
};ColorValue
ts
type ColorValue = {
value?: Color;
};TextValue
valueText or encodable value rendered by the component.
ts
type TextValue = {
value?: Encodable;
};GaugeValue
valueNumber value in range 0~1.
ts
type GaugeValue = {
value?: number;
};ImageValue
urlLocal or remote path such asimg.pngpath/img.pnghttps://example.com/img.pngresizableThe modes used to resize an image to fit within its containing view.interpolationThe level of quality for rendering an image that requires interpolation, such as a scaled image.styleThe mode that indicates how images are renderedaccentedThe mode that indicates how images are rendered on widget accented modemaxPixelThe maximum number of pixels along the image's longest edge. Defaults to 1000.
ts
type ImageValue = {
url?: string;
resizable?: Resizable;
interpolation?: Interpolation;
style?: TemplateRenderingMode;
accented?: Accented;
maxPixel?: number;
};IconValue
valueThe name of the system symbol image. Use the SF Symbols app to look up the names of system symbol images.
ts
type IconValue = {
value?: string;
};TimeValue
timeZoneIANA time-zone identifier. Omit to use the system time zone.
ts
type TimeValue =
| {
timeZone?: string;
format?: DateFormatToken[];
date?: never;
style?: never;
countsDown?: never;
showsHours?: never;
}
| {
date?: Date;
style?: TimeStyle;
timeZone?: never;
format?: never;
countsDown?: never;
showsHours?: never;
}
| {
date?: Date;
countsDown?: boolean;
showsHours?: boolean;
timeZone?: never;
format?: never;
style?: never;
};ProgressViewValue
countsDownDefault true. Only applies when value is a date range.
ts
type ProgressViewValue = {
value: number | [start: Date, end: Date];
countsDown?: boolean;
};SvgValue
urlFor example,img.png,path/img.png, orhttps://example.com/img.png.valueFor example,<svg><path d="M0 0h10v10h-10z"/></svg>.
ts
type SvgValue = {
url?: string;
value?: string;
};SpacerValue
ts
type SpacerValue = {
minLength?: number;
};GifValue
ts
type GifValue = {
size: Size;
duration: GifDuration;
};TickerValue
ts
type TickerValue = {
size: Size;
style: TickerStyle;
};FlashTickerValue
ts
type FlashTickerValue = {
size: Size;
};AxisFlipValue
ts
type AxisFlipValue = {
index: number;
curr: NativeView;
prev: NativeView;
perspective?: number;
};FlipValue
ts
type FlipValue = AxisFlipValue & {
delta: number;
shadowOpacity?: number;
leadingHidden?: boolean;
trailingHidden?: boolean;
};Mods
ts
type Mods = {
[K in keyof BaseMods]?: BaseMods[K];
} & {
[K in keyof BaseMods as `${K & string}_${string}`]?: BaseMods[K];
};BaseMods
clockEffectThis modifier is currently available, but future availability is uncertain.minimumScaleFactorThere is a known issue where minimumScaleFactor may stop working when lineHeight is used.
ts
type BaseMods = {
animation?: NativeAnimation | number | '';
aspectRatio?: AspectRatio;
background?:
| ShapeStyle
| NativeView
| {alignment: Alignment; content: NativeView};
baselineOffset?: number;
blendMode?: BlendMode;
blur?: Blur;
brightness?: number;
buttonStyle?: ButtonStyle | '';
clipped?: boolean;
clipShape?: NativeView | '';
clockEffect?: number | 'second' | 'minute' | 'hour';
colorInvert?: boolean;
colorMultiply?: Color;
compositingGroup?: boolean;
contentShape?: NativeView | '';
contentTransition?: ContentTransition;
contrast?: number;
cornerRadius?: number;
debug?: boolean;
disable?: boolean;
drawingGroup?: boolean;
fixedSize?: FixedSize;
font?: Font | '';
fontDesign?: FontDesign | '';
fontSize?: number;
fontWeight?: FontWeight | '';
fontWidth?: FontWidth | '';
foreground?: ShapeStyle;
frame?: Frame;
gaugeStyle?: GaugeStyle;
geometryGroup?: boolean;
grayscale?: number;
height?: number;
hidden?: boolean;
hueRotation?: number;
ignoresSafeArea?: boolean;
italic?: boolean;
kerning?: number;
layoutPriority?: number;
lineHeight?: LineHeight | '';
lineLimit?: number | '';
lineSpacing?: number;
luminanceToAlpha?: boolean;
mask?: NativeView;
maxHeight?: Dimension | boolean;
maxSides?: Dimension | boolean;
maxWidth?: Dimension | boolean;
minimumScaleFactor?: number;
monospaced?: boolean;
monospacedDigit?: boolean;
offset?: Point;
offsetX?: number;
offsetY?: number;
opacity?: number;
overlay?:
| ShapeStyle
| NativeView
| {alignment: Alignment; content: NativeView};
padding?: Padding | boolean;
pixelPerfectCenter?: boolean | Point;
position?: Point;
progressViewStyle?: ProgressViewStyle;
reverseMask?: NativeView;
rotation3DEffect?: Rotation3DEffect;
rotationEffect?: RotationEffect;
safeAreaInset?:
| {edge: HorizontalEdge; alignment: VerticalAlignment; content: NativeView}
| {edge: VerticalEdge; alignment: HorizontalAlignment; content: NativeView};
saturation?: number;
scaleEffect?: ScaleEffect;
shadow?: Shadow;
sides?: number;
strikethrough?:
| boolean
| {isActive?: boolean; pattern?: Pattern; color?: Color};
test?: unknown;
textAlignment?: TextAlignment;
tint?: ShapeStyle;
tracking?: number;
transform?: [number, number, number, number, number, number];
transition?: Transition;
truncationMode?: 'head' | 'middle' | 'tail';
typesettingLanguage?: string;
underline?: boolean | {isActive?: boolean; pattern?: Pattern; color?: Color};
width?: number;
zIndex?: number;
};