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.
<Icon name="truck" size="lg" color="info" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | — | 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. |
size | xs | sm | md | lg | xl | 2xl | 3xl | md | Icon size: 12, 14, 16, 20, 24, 30 or 32 px. |
color | color | current text color | Stroke color. Accepts theme tokens such as secondary, success or danger, or any CSS color. |
fill | color | none | Fill 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:
| Alias | Shows |
|---|---|
agent | bot |
analytics, chart | bar chart |
batch | boxes |
book-clock | clock |
book-closed | book |
check-circle-filled | filled check circle |
circle-question | circle help |
confetti | party popper |
cube | box |
desktop | monitor |
document, page-blank, square-text | file text |
dots-horizontal | more horizontal |
dots-vertical | more vertical |
empty-circle | circle |
images, square-image | images |
keys | key |
lab | flask |
lifesaver | life buoy |
maps | map |
mobile | smartphone |
name, profile | user |
notebook-pencil | notebook pen |
profile-card | contact |
reload | rotate counter-clockwise |
settings-slider | sliders horizontal |
sparkle, sparkle-double | sparkles |
square-code | code |
star-filled | star |
suitcase | briefcase |
wreath | award |
write, write-alt, write-alt2 | square pen |
Image
Shows an image, with control over its size, crop and corners. It can also be clickable.
<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:
<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:
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | { light, dark } | — | Image address. With no src, nothing is shown. |
alt | string | — | Text read by screen readers, and the image's name when it's clickable. |
fit | cover | contain | fill | scale-down | none | cover | How the image fills its box, as in CSS object-fit. |
position | center | top | bottom | left | right | top left | top right | bottom left | bottom right | center | Which part stays in view when the image is cropped. |
radius | radius | md | Corner rounding. |
frame | boolean | false | Adds a thin border around the image. |
flush | boolean | false | Stretches the image to the edges of its container, ignoring padding. |
onClickAction | action | — | Function to run when the image is clicked. |
Badge
A small label for a status, category or tag.
<Badge label="Shipped" color="info" /><Badge label="Delayed" color="danger" variant="solid" pill={false} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | The badge text. |
color | secondary | success | danger | warning | caution | info | discovery, or any color | secondary | Badge color. |
variant | solid | soft | outline | soft | solid fills the badge, soft tints it, and outline draws only a border. |
size | sm | md | lg | sm | Badge size. |
pill | boolean | true | Fully 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.
<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.
<Row gap={2}>
<Favicon url="https://www.dhl.com" alt="DHL" frame />
<Text value="Tracked by DHL" size="sm" />
</Row>Props
| Prop | Type | Default | Description |
|---|---|---|---|
url | string | — | The site whose icon to show. |
alt | string | — | Text read by screen readers. |
size | number | 12 | Size in pixels. |
frame | boolean | false | Adds a thin ring around the icon. |
IFrame
Embeds a web page inside the Widget, such as a map or a booking page.
<IFrame src="https://calendly.com/acme/fitting" title="Book a fitting" height={420} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | — | The page to embed. It must start with https://. |
title | string | Embedded widget content | Accessible name of the frame. |
height | number | string | at least 120 px | Frame height. |
allow | string | — | Browser features the page may use, as in the HTML allow attribute. |
sandbox | string | allow-forms allow-popups allow-scripts | What the page may do, as in the HTML sandbox attribute. |
flush | boolean | false | Stretches the frame to the edges of the card. |