Styling

Override every visual aspect through CSS variables. No theme provider, no prop drilling — just CSS.

Tweak colors, sizes, and modes visually in the Edit Appearance editor — when it looks right, copy the generated CSS straight into your project. Faster than hand-tuning the variables below.

Open Edit Appearance

Style injection

Styles auto-inject at runtime when the component first renders. There's no separate CSS file to import. Defaults use :where() (zero specificity) so any override you write wins without !important.

CSS variables

Override these on the container element (via className or id). All defaults use :where() — your overrides always win.

VariableLightDarkDescription
--aia-pill-bg#bdbdbd#bdbdbdPill background.
--aia-pill-color#000000#ffffffPill text.
--aia-pill-font-size19px19pxPill font size.
--aia-option-bgtransparenttransparentHighlighted option background.
--aia-option-color#000000#ffffffOption text.
--aia-option-color-selected#000000#ffffffHighlighted option text.
--aia-option-font-size19px19pxOption font size.
--aia-written-text-color#000000#ffffffInput text.
--aia-written-text-font-size19px19pxInput text font size.
--aia-caret-color--aia-written-text-color--aia-written-text-colorTextarea caret color. Override independently of input text color.
--aia-submit-bg#000000#ffffffSubmit button background.
--aia-submit-color#ffffff#000000Submit button icon color.
--aia-dropdown-bgOptional bg the dropdown's glass shadow tints toward. Set to your page bg so the bottom-corner glow blends.
--aia-scrollbar-thumbrgba(0,0,0,0.3)rgba(0,0,0,0.3)Color of the option list's scrollbar thumb (Firefox + WebKit).
--aia-streak-rgb99, 102, 241255, 255, 255Comma-separated RGB triplet that tints the option-selection streak animation.
--aia-streak-glass-bgrgba(99,102,241,0.1)rgba(255,255,255,0.1)Background fill for the streak's glass-pill effect.

Selector hooks

For styling beyond the CSS variables, target these stable data-aia-* attributes. CSS-module class hashes are not part of the public API.

  • [data-aia-editor]Editor area wrapping the textarea + overlay.
  • [data-aia-textarea]The <textarea>.
  • [data-aia-submit]Submit button.
  • [data-aia-pill]Each unfilled-suggestion pill.
  • [data-aia-pillbar]Pill bar container inside the dropdown.
  • [data-aia-option]Each suggestion option.
  • [data-aia-dropdown]The dropdown root (listbox).
dropdown.css
/* Solid (non-glass) dropdown */
.my-autocomplete [data-aia-dropdown] {
background: #fff;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
backdrop-filter: none;
}

Per-mode overrides

Use the data-mode attribute to scope overrides to light or dark mode.

theme.css
.my-autocomplete[data-mode="light"] {
--aia-pill-bg: #e2e8f0;
--aia-pill-color: #0f172a;
}
.my-autocomplete[data-mode="dark"] {
--aia-pill-bg: #334155;
--aia-pill-color: #f8fafc;
}

Live preview

CSS variables update live — set them imperatively to preview color changes without re-renders.

livePreview.ts
document
.querySelector<HTMLElement>(".my-autocomplete")
?.style.setProperty("--aia-pill-bg", newColor);