Skip to content
QwryAI
Documentation
Pages

Widgets

Media & Visual

Visual components for a Widget: Icon, Image, Badge, Transition, Favicon and IFrame

Icon

Shows an icon from the Lucide set, or one of QwryAI's short aliases. Use icons to give labels, buttons and rows visual context.

jsx
<Icon name="truck" size="lg" color="info" />

Props

PropTypeDefaultDescription
namestring—A Lucide icon name, such as "calendar-days" or "arrow-right", or an alias. Names are matched without regard to case or dashes, so "CalendarDays" works too. An unknown name shows nothing.
sizexs | sm | md | lg | xl | 2xl | 3xlmdIcon size: 12, 14, 16, 20, 24, 30 or 32 px.
colorcolorcurrent text colorStroke color. Accepts theme tokens such as secondary, success or danger, or any CSS color.
fillcolornoneFill color, for a solid icon such as a filled star.

Icon field format

Props that take an icon, such as a Button's iconStart or a Card's status.icon, accept either form:

  • A name: "heart"
  • An object with a color: { "name": "heart", "color": "danger" }

Icon aliases

Besides every Lucide name, these short names are available:

AliasShows
agentbot
analytics, chartbar chart
batchboxes
book-clockclock
book-closedbook
check-circle-filledfilled check circle
circle-questioncircle help
confettiparty popper
cubebox
desktopmonitor
document, page-blank, square-textfile text
dots-horizontalmore horizontal
dots-verticalmore vertical
empty-circlecircle
images, square-imageimages
keyskey
labflask
lifesaverlife buoy
mapsmap
mobilesmartphone
name, profileuser
notebook-pencilnotebook pen
profile-cardcontact
reloadrotate counter-clockwise
settings-slidersliders horizontal
sparkle, sparkle-doublesparkles
square-codecode
star-filledstar
suitcasebriefcase
wreathaward
write, write-alt, write-alt2square pen

Image

Shows an image, with control over its size, crop and corners. It can also be clickable.

jsx
<Image src={productImage} alt={productName} size={56} radius="md" fit="cover" />

Give src an object to use a different image in light and dark mode:

jsx
<Image src={{ light: logoLight, dark: logoDark }} width={160} height={40} fit="contain" />

Props

Image accepts the sizing and spacing props of layout components (width, height, size, the min and max sizes, aspectRatio, radius, background, margin, flex and more), plus:

PropTypeDefaultDescription
srcstring | { light, dark }—Image address. With no src, nothing is shown.
altstring—Text read by screen readers, and the image's name when it's clickable.
fitcover | contain | fill | scale-down | nonecoverHow the image fills its box, as in CSS object-fit.
positioncenter | top | bottom | left | right | top left | top right | bottom left | bottom rightcenterWhich part stays in view when the image is cropped.
radiusradiusmdCorner rounding.
framebooleanfalseAdds a thin border around the image.
flushbooleanfalseStretches the image to the edges of its container, ignoring padding.
onClickActionaction—Function to run when the image is clicked.

Badge

A small label for a status, category or tag.

jsx
<Badge label="Shipped" color="info" />
jsx
<Badge label="Delayed" color="danger" variant="solid" pill={false} />

Props

PropTypeDefaultDescription
labelstring—The badge text.
colorsecondary | success | danger | warning | caution | info | discovery, or any colorsecondaryBadge color.
variantsolid | soft | outlinesoftsolid fills the badge, soft tints it, and outline draws only a border.
sizesm | md | lgsmBadge size.
pillbooleantrueFully rounded ends. Set pill={false} for slightly rounded corners.

Transition

Animates between views. Put two or more children inside, each shown only in some state; Transition shows the first child that is visible and fades between them when that changes.

jsx
<Transition>
  <Stack widgetStateName="Checking" visible={{ "$state": "/status", "eq": "checking" }}>
    <Text value="Checking your order…" />
  </Stack>
  <Stack widgetStateName="Found" visible={{ "$state": "/status", "neq": "checking" }}>
    <Text value={statusLine} />
  </Stack>
</Transition>

The outgoing view fades out over 0.2 seconds and the new one fades in over 0.3 seconds. Transition has no props.

Favicon

A small round site icon for a web address, useful beside links and sources.

jsx
<Row gap={2}>
  <Favicon url="https://www.dhl.com" alt="DHL" frame />
  <Text value="Tracked by DHL" size="sm" />
</Row>

Props

PropTypeDefaultDescription
urlstring—The site whose icon to show.
altstring—Text read by screen readers.
sizenumber12Size in pixels.
framebooleanfalseAdds a thin ring around the icon.

IFrame

Embeds a web page inside the Widget, such as a map or a booking page.

jsx
<IFrame src="https://calendly.com/acme/fitting" title="Book a fitting" height={420} />

Props

PropTypeDefaultDescription
srcstring—The page to embed. It must start with https://.
titlestringEmbedded widget contentAccessible name of the frame.
heightnumber | stringat least 120 pxFrame height.
allowstring—Browser features the page may use, as in the HTML allow attribute.
sandboxstringallow-forms allow-popups allow-scriptsWhat the page may do, as in the HTML sandbox attribute.
flushbooleanfalseStretches the frame to the edges of the card.

Next steps

Explore the documentation