For AI agents: a documentation index is available at /llms.txt, and the full corpus at /llms-full.txt. A markdown version of any page on this site is available by appending .md to its URL path — the homepage is at /index.md.

Styling

One value type — AIAutocompleteAppearance — holds every visual token: fonts, colors, radii, spacing, animation. Defaults follow the stock design and adapt to light/dark automatically.

Applying an appearance

Build a value, override what you need, and apply it — the environment modifier in SwiftUI, the appearance property in UIKit.

BrandAppearance.swift
import AIAutocompleteUIKit
var brand = AIAutocompleteAppearance()
brand.font = .systemFont(ofSize: 18)
brand.inputCornerRadius = 12
brand.pillBorderStyle = .dashed
brand.pillBorderColor = .systemIndigo
brand.columns = 2
// SwiftUI — applies to every AIAutocomplete / AIAutocompleteDropdown below it
AIAutocomplete(configuration: config)
.aiAutocompleteAppearance(brand)
// UIKit — assign to the view; restyles in place
autocompleteView.appearance = brand

Light and dark mode

Every default color is a dynamic UIColor that resolves against the system appearance — light and dark both look right with no work. Custom colors can do the same: pass a UIColor closure keyed on userInterfaceStyle, or an asset-catalog color.

DynamicColors.swift
var appearance = AIAutocompleteAppearance()
appearance.inputBackgroundColor = UIColor { traits in
traits.userInterfaceStyle == .dark ? .black : .white
}

Typography

PropTypeDefaultDescription
fontUIFont16pt system, Dynamic TypeBase font for input text and completed params; pills and options fall back to it. Scales with Dynamic Type.
pillFontUIFont?nil (falls back to font)Pill chip font.
optionFontUIFont?14pt system, Dynamic TypeDropdown option font.
optionSelectedFontWeightUIFont.Weight.semiboldFont weight of the highlighted / selected option's text; the regular face is restored on deselect. Applied through the descriptor, so a custom optionFont keeps its family.
maxInputLinesInt?5Lines the input grows to before scrolling internally. nil grows without bound.
lineSpacingCGFloat9Extra spacing between wrapped input lines, in points.
maximumContentSizeCategoryUIContentSizeCategory.accessibilityExtraLargeDynamic Type cap for option text — scales up to this category and no further.

Colors

All UIColor. Defaults are dynamic light/dark pairs mirroring the web SDK's stock palette.

PropTypeDescription
textColorUIColorFree-typed text and completed params in the input.
placeholderColorUIColorPlaceholder text and unfilled placeholder pills.
caretColorUIColorThe text caret.
pillBackgroundColor / pillTextColorUIColorPill fill and label text. The stock fill is transparent and the stock border style is .none, so pills read as plain labels.
pillBorderColorUIColorOutline color of unfilled pills.
completedParamBackgroundColor / completedParamActiveBackgroundColorUIColorCompleted-param chip fill — resting, and while the param is re-edited. Used when completedParamEmphasis contains .highlight.
completedParamTextColorUIColor?Completed-param chip text color. Defaults to the solid fill's inverse ink (white on light, black on dark); nil follows textColor instead.
completedParamShimmerColorUIColor?Band tint of the promotion glint swept across a just-completed param. nil (the default) follows the chip fill, so the glint reads on the chip's ink and stays invisible over the fill.
inputBackgroundColor / inputBorderColorUIColorInput surface fill and border.
dropdownBackgroundColor / dropdownBorderColorUIColorDropdown surface fill and border (solid mode).
optionTextColor / optionSelectedTextColorUIColorOption text, normal and highlighted.
optionHighlightBackgroundColorUIColorHighlighted option's background fill.
shimmerColorUIColorLoading shimmer / skeleton base.
submitButtonBackgroundColor / submitButtonForegroundColorUIColorBuilt-in submit button fill and glyph. Ignored with a custom button.

Pills and completed params

Unfilled suggestion pills render as hollow small-caps chips — no fill, with a solid outline on the pill being filled (queued pills wait borderless; outline them all via showsInactivePillBorders). Once a param is filled it renders as a solid high-contrast capsule — black on light, white on dark, with inverse ink — that lifts toward the surface while it's being re-edited. Every look is tokenized: restyle the outline, pick a different emphasis, or turn the chips off entirely.

PillStyles.swift
var appearance = AIAutocompleteAppearance()
// Unfilled pills: a solid outline on the ACTIVE pill by default —
// restyle it, outline every pill, or drop outlines entirely
appearance.pillBorderStyle = .dashed // or .solid (default) / .none
appearance.pillBorderColor = .systemIndigo
appearance.showsInactivePillBorders = true // outline the queued pills too
// Completed params: a solid black/white capsule by default (.highlight)
appearance.completedParamEmphasis = [.highlight, .bold] // fill + semibold
appearance.completedParamEmphasis = .bold // semibold only
appearance.completedParamEmphasis = [] // plain text
PropTypeDefaultDescription
pillBorderStyle.none | .dashed | .solid.solidPill outline: .none (plain label text), .dashed, or .solid — inline and in the dropdown pill bar.
pillBorderWidthCGFloat1Width of the pill outline.
showsInactivePillBordersBoolfalsefalse reserves the pill outline for the active param alone, so the queue reads as one outlined slot being filled. Inert when pillBorderStyle is .none.
completedParamEmphasisCompletedParamEmphasis.highlight.highlight draws the chip fill (with horizontal room reserved around each param), .bold sets semibold text. Combine both, or pass [] for plain text.

Layout

PropTypeDefaultDescription
inputCornerRadiusCGFloat12Input surface radius.
dropdownCornerRadiusCGFloat12Dropdown card radius.
pillCornerRadiusCGFloat6Pill chip radius, clamped to half the chip height — a rounded rectangle by default.
optionCornerRadiusCGFloat4Highlighted option fill (and streak) radius.
inputBorderWidth / dropdownBorderWidthCGFloat0.8 / 0.2Hairline borders around the input and dropdown.
inputInsetsUIEdgeInsets10pt all sidesPadding between the input surface's edge and its content.
dropdownGapCGFloat6Vertical gap between input and dropdown.
dropdownMaxHeightCGFloat?nilOptional hard cap on the option grid's height, in points. Applied together with maxVisibleOptionRows and the keyboard bound — the smallest wins.
maxVisibleOptionRowsInt?5Option rows shown before the grid scrolls. Expressed in rows, so the cap tracks the option font and Dynamic Type. nil removes the cap.
optionLeadingInsetCGFloat5Extra leading inset for option text. The default lines options up with the input's text; 0 lines them up with the dropdown pill bar instead.
optionVerticalPaddingCGFloat9.75Vertical padding around each option's text — the text-to-text gap between adjacent options is twice this. Options wrap to as many lines as they need; each row is exactly tall enough for its option.
completedParamHorizontalPadding / completedParamVerticalPaddingCGFloat7 / 2.5Chip capsule padding around the param's text, per side. Vertical expands into the line gap — keep it at or below half of lineSpacing, or wrapped chips overlap the line above.
dropdownShadowShadow?.defaultDrop shadow cast by the dropdown card — the stock .default is a soft shadow (offset y 8pt, blur radius 6pt). nil draws no shadow. Solid mode only; glass supplies its own depth.
columnsInt1Columns in the option grid.
submitButtonSize / submitButtonSpacingCGFloat28 / 12Built-in submit button diameter and its gap from the text.

Animation, haptics, surfaces

PropTypeDefaultDescription
animationsBooltrueMaster switch for the selection streak and shimmer. The system Reduce Motion setting always wins.
hapticsBooltrueLight haptic tick on param promotion. Independent of animations.
dropdownSurface.solid | .glass.solidSolid fill, or system glass.
showBrandFooterBoolfalseWhether the AI Autocomplete brand row renders at the dropdown's far edge. Hiding it also releases the scroll band reserved beneath it.