Skip to main content

Widgets

Daisy

sn_aiux ships with a styling system based on Tailwind CSS and DaisyUI, bundled and prefixed under aiux-. You have two distinct surfaces to work with: pre-built <aiux-*> web components for high-level pieces (dialog, alert, accordion, etc.), and Tailwind/DaisyUI utility classes (e.g. aiux-cardaiux-table-zebraaiux-badge-primary) for everything else.

Pick whichever fits the task. The web components give you semantics, accessibility, slotting, and configurable behavior in one tag. The utility classes give you fine-grained composition without writing CSS. Most real widgets use both.


Pre-built <aiux-*> components

All registered globally — just use the tag. Where a side-effect import is needed, it looks like import '@servicenow/aiux-components-core/aiux-alert-message'.

Attribute vs property: lowercase kebab-case names like is-modal are HTML attributes. Names prefixed with . (e.g. .items) are Lit JS property bindings — used when the value is a non-string (an array, object, etc.).

<aiux-accordion-group>

Collapsible sections with arrow or plus icons.

Attr/PropertyTypeDescription
.itemsArray{title, content, open?}
multiplebooleanAllow multiple open items
iconstring"arrow" | "plus"
borderedbooleanShow item borders
onchangestringCallback code; detail {index, title, open}

<aiux-alert-message>

Inline alert / banner.

Attr/PropertyTypeDescription
typestring"info" | "success" | "warning" | "error" | "primary" | "accent"
messagestringBody text
alert-titlestringOptional title
dismissiblebooleanShow dismiss button
iconstringCustom icon name (overrides default)
durationnumberAuto-dismiss ms (0 = none)
autofocus-controlsbooleanAutofocus dismiss button

<aiux-calendar-component>

Month-view calendar with selectable date.

Attr/PropertyTypeDescription
.currentDateObjectDisplayed month {month, year}
.selectedDateObjectSelected date

Slideshow with optional autoplay, dot indicators, and navigation buttons.

Attr/PropertyTypeDescription
.itemsArraySlide content items
show-navigationbooleanPrev/next buttons
show-indicatorsbooleanDot indicators
autoplaynumberAutoplay interval ms (0 = off)
alignmentstringSlide alignment
verticalbooleanVertical orientation
onchangestringCallback; detail {index, previousIndex}

<aiux-dialog>

Modal or non-modal dialog with header, body, and footer slots.

Attr/PropertyTypeDescription
openbooleanDialog is open
sizestring"sm" | "md" | "lg" | "xl" | "fullscreen"
is-modalbooleanRender as modal
show-close-buttonbooleanShow close button
close-on-escapebooleanClose on Escape
close-on-backdrop-clickbooleanClose on backdrop click
prevent-scrollbooleanPrevent body scroll when modal open
resizablebooleanDrag-to-resize
hide-paddingbooleanRemove header/body/footer padding
dialog-labelstringaria-label
.customSizeObject{width, height}

<aiux-icon>

Inline icon rendered from the framework's icon library.

Attr/PropertyTypeDescription
namestringIcon name in kebab-case (e.g. "play-fill")
sizestring"xs" | "sm" | "md" | "lg" | "xl"
.configAriaObject{role, label}

<aiux-live-region>

ARIA live region for accessibility announcements.

Attr/PropertyTypeDescription
modestring"polite" | "assertive" | "off"
atomicbooleanaria-atomic
relevantstringaria-relevant
visually-hiddenbooleanInvisible but still announced
region-rolestringOverride role

<aiux-loader>

Spinner / loading indicator.

Attr/PropertyTypeDescription
sizestring"xs" | "sm" | "md" | "lg" | "xl"
labelstringAccessible loading label
.animationConfigObjectLottie config
show-footerbooleanShow footer logo

<aiux-pagination-nav>

Page-number navigation control.

Attr/PropertyTypeDescription
current-pagenumberActive page (1-based)
total-pagesnumberTotal pages
max-buttonsnumberMax page buttons
show-prev-nextbooleanPrev/next arrows
show-first-lastbooleanFirst/last arrows
sizestring"xs" | "sm" | "md" | "lg" | "xl"
onchangestringCallback; detail {page, previousPage, totalPages}

<aiux-tab-group>

Tabbed sections.

Attr/PropertyTypeDescription
.tabsArray{label, id, content?, disabled?}
active-tabstringActive tab id
variantstring"boxed" | "bordered" | "lifted"
placementstring"top" | "bottom"
sizestring"xs" | "sm" | "md" | "lg" | "xl"
namestringGroup name
stretchbooleanStretch to fill width
onchangestringCallback; detail {id, label, index}

<aiux-toast-notification>

Stand-alone toast (the notifications service produces these — see Component → Services).

Attr/PropertyTypeDescription
typestring"info" | "success" | "warning" | "error"
messagestringBody text
positionstringScreen position
dismissiblebooleanShow dismiss button
iconstringCustom icon name
durationnumberAuto-dismiss ms
visiblebooleanShow/hide
ondismissstringCallback on dismiss

<aiux-time-selector>

12/24-hour time input.

Attr/PropertyTypeDescription
is-12-hourboolean12-hour format with AM/PM toggle (default true)
valuestringInitial time in HH:MM (24-hour)
disabledbooleanDisable all inputs
sizestring"sm" | "md" | "lg"

DaisyUI utility classes

Tailwind plus DaisyUI is bundled with sn_aiux, with every class prefixed aiux-. Common ones you'll reach for:

  • Cards: aiux-cardaiux-card-bodyaiux-card-titleaiux-card-borderedaiux-shadow-md
  • Tables: aiux-tableaiux-table-zebraaiux-table-sm
  • Badges: aiux-badgeaiux-badge-primaryaiux-badge-outlineaiux-badge-ghost
  • Buttons: aiux-btnaiux-btn-primaryaiux-btn-dashaiux-btn-ghost
  • Alerts (utility variant): aiux-alertaiux-alert-infoaiux-alert-error
  • Modals (utility variant): aiux-modalaiux-modal-openaiux-modal-toggle
  • Layout: aiux-bg-base-100aiux-bg-base-200aiux-divideraiux-overflow-x-auto
  • Typography: aiux-text-smaiux-text-xsaiux-opacity-70aiux-opacity-60
  • Spacing: aiux-p-3aiux-rounded

When in doubt, search the bundled CSS file (/sncapps/aix/assets/aiux-kit-*.css) for the class name you want — every DaisyUI utility ships with the aiux- prefix applied.

Picking between a component and a utility

  • Use <aiux-alert-message> when you want a configurable, accessible, dismissible alert with a typed type attribute.
  • Use aiux-alert aiux-alert-info classes when you just need a styled box around your own content.
  • Use <aiux-dialog> when you want a real modal with focus trapping, escape handling, and a backdrop.
  • Use aiux-modal utility classes when you want to style a custom overlay that doesn't behave like a true modal.

The pattern generalizes: pre-built component for behavior + accessibility, utility classes for composition.