Payment Successful
Your order has been confirmed
Processing
Hang tight…
String prop
Install failed injected
Snippet
Install failed <span data-pw="injected-markup">injected</span>
Inline
Embedded in a page, not a full screen.
With action
Something needs your attention.
Action area
Named icon
statusIconAlt sets the accessible name.
Decorative icon
An empty statusIconAlt marks the icon decorative.

Order Confirmed

Renders statusText as an h2.

Documentation

A full-screen status display with a centered icon image, title text, description text, and an optional action Button. Uses backdrop-filter blur for visual effect. Ideal for order success/failure screens.

The statusDescription string is rendered with {@html}, so a caller can pass its own trusted markup. For a description that comes from an API, a user, or anywhere else the caller does not control, use the descriptionSnippet snippet instead — it renders the text escaped.

Usage

<script>
  import { Status } from '@juspay/svelte-ui-components';
</script>

<Status />

Props

Prop Type Required Default Description
statusIcon string No built-in checkmark URL of the status icon image displayed at the center (e.g., success checkmark, error cross). Omit it to get the built-in checkmark, which is inlined, so it needs no request and no packaged file. A URL you pass is used exactly as given and is never replaced when it fails to load. See Default icon.
statusIconAlt string No 'status' Accessible name for the statusIcon image. Deliberately generic by default, because the same icon shape serves success and failure screens. Set it to what the screen means, or to '' to mark the icon decorative when statusText already carries the meaning.
statusText string No '' Main status title text (e.g., 'Order Successful', 'Payment Failed').
statusTextTag 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' No 'div' Element statusText renders as. Set to a heading tag when statusText is a real page/section heading — only then does it pick up an app's semantic-tag typography (size, weight, colour) and join the document outline for assistive tech. The default div renders exactly as before.
statusDescription string No '' Description text below the title. Supports HTML content (rendered via {@html}).
buttonProperties ButtonProperties No - Optional ButtonProperties object for an action button below the description (e.g., 'Try Again', 'Go Home').
classes string No - CSS class string applied to the component's top-level element. Useful for theming — define classes with CSS variable overrides and pass them to create variant styles.
icon Snippet No - Custom media rendered in place of the statusIcon image. Takes priority over statusIcon.
descriptionSnippet Snippet No - Replaces the statusDescription string at render time and escapes its content. Takes priority over statusDescription.
children Snippet No - Action area rendered below the description, outside .status-description and its padding.
testId string No - Value applied to the data-pw attribute on the root element for test selection.

Events

Event Type Description
onbuttonclick () => void Fires when the action button (configured via buttonProperties) is clicked.

Snippets

Svelte 5 Snippet props — pass content blocks to the component.

Snippet Type Description
icon Snippet Media rendered in place of the default statusIcon image — e.g. a LottiePlayer for animated success/failure/in-progress states.
descriptionSnippet Snippet Rich-markup or escaped-text override for the description area. When provided it takes full rendering priority over statusDescription.
children Snippet Action area below the description — buttons, links, a countdown. Rendered outside .status-description, alongside the buttonProperties button.

Default icon

Leave statusIcon out and the component renders a built-in checkmark that is inlined into it. There is no request and no file to package, so it renders identically from the Svelte component and from <sui-status>, at any route depth and under any base path:

<Status statusText="Payment Successful" statusDescription="Your order has been confirmed" />
<sui-status status-text="Payment Successful"></sui-status>

A URL you pass is used exactly as given. If it fails to load, the broken image stays broken: answering a failed failure-icon with a success checkmark would be worse than showing nothing.

The default used to be the relative URL 'icons/order-success-icon.svg', a file the library never shipped. It resolved against the page rendering the component (so to /components/icons/order-success-icon.svg on a nested route), made a request that returned 404 and only then fell back to the checkmark. An app that serves that file at its own root and relied on it should now pass the URL explicitly:

<Status statusIcon="/icons/order-success-icon.svg" statusText="Payment Successful" />

The literal 'icons/order-success-icon.svg' is the one value that still falls back to the built-in checkmark when it cannot be fetched, so a caller that spelled out the former default is unchanged.

Rendering a description you do not control

statusDescription is interpolated with {@html}. That is the right tool when the caller owns the markup, and the wrong one for a message that arrives from an API or a user — such a string would be parsed as markup. descriptionSnippet renders the same value through ordinary Svelte interpolation, which escapes it:

<script>
  import { Status } from '@juspay/svelte-ui-components';

  // e.g. the `message` field of an API response
  let { message } = $props();
</script>

<Status statusText="Installation failed" statusDescription="">
  {#snippet descriptionSnippet()}{message}{/snippet}
</Status>

CSS Variables

Override these custom properties to theme the component.

Variable Default CSS Property Description
--status-min-height 100vh min-height Minimum height of the .background container. Controls the overall height of the status screen.
--status-font-weight 600 font-weight Font weight of the status title text. Used with different fallbacks: 600 on status text and 400 on description.
--status-description-font-color #2f3841 color Color of the description text. Used with different fallbacks: #2f3841 on status text and #436484cc on the description paragraph.
--status-icon-color inherit color Color applied to .status-image, the container around the status icon (icon snippet or the default <Img>). Inline SVG content using currentColor picks this up.
--order-font inherit font-family Font family for the status text.
--order-font-size 14px font-size Font size for the status text.
--status-panel-background rgba(255, 255, 255, 0.6) background-color Background of the inner status panel, applied only where backdrop-filter is supported. Set to transparent when embedding the component inside an existing page.
--status-panel-backdrop-filter blur(60px) backdrop-filter Backdrop filter on the inner status panel. Set to none alongside --status-panel-background to remove the frosted panel entirely.

Dark theme

--status-description-font-color and --status-panel-background default to fixed light-mode literals (a dark-on-light text color, a translucent white panel). --status-icon-color defaults to inherit, which is not theme-neutral either — with no ancestor setting color, it resolves to the browser's default black text color. None of the three defaults adapts to a surrounding dark theme, and nothing fails when they don't: an app that defines none of them gets light-themed status text, icon, and panel inside a dark UI with no error, warning, or visual glitch to flag it. An app with a dark theme must define all three explicitly — there is no way for the component to detect the theme around it.

Rendering statusText as a real heading

statusText renders inside a plain <div class="status-text"> by default, so it carries no heading semantics — it doesn't join the document outline, and an app whose design system wires typography to semantic tags (h1–h6) rather than setting font-size in component styles has no tag to target. .status-text itself only sets font-weight and color — it never sets font-size — so switching the tag via statusTextTag lets the surrounding app's own heading styles size it, with no change to Status's own CSS:

<Status
  statusText="Payment Successful"
  statusTextTag="h1"
  statusDescription="Your order has been confirmed"
/>

Omit statusTextTag (or pass 'div') and rendering is byte-identical to before this prop existed.

Description text vs. action content

.status-description carries the component's own horizontal padding and bottom margin, so anything rendered through descriptionSnippet inherits a text box's geometry. That is right for the message and wrong for a control. Put buttons, links and countdowns in children, which renders below the description and outside that box:

<Status statusText="Installation failed" statusDescription="">
  {#snippet descriptionSnippet()}{message}{/snippet}
  {#snippet children()}
    <Button text="Try again" onclick={retry} />
  {/snippet}
</Status>

Embedding Status inside an existing page

Status is styled as a standalone result screen: 100vh tall, with a translucent frosted panel. Rendered inside a page that already has its own heading and surrounding content, both are wrong — the height pushes siblings below the fold, and the panel's light background does not survive a dark theme.

All three are variables, so an inline consumer neutralises them:

<div
  style="
    --status-min-height: auto;
    --status-panel-background: transparent;
    --status-panel-backdrop-filter: none;
  "
>
  <Status statusText="Finishing installation" statusDescription="Almost there…" />
</div>

Type Reference

Custom types used by this component's props and events:

ButtonProperties

type ButtonProperties = {
  text?: string;
  enable?: boolean;
  showProgressBar?: boolean;
  showLoader?: boolean;
  loaderType?: 'Circular' | 'ProgressBar';
  type?: 'submit' | 'reset' | 'button';
  testId?: string;
  icon?: Snippet;
  children?: Snippet;
  ariaLabel?: string;
  ariaExpanded?: boolean;
  disabled?: boolean;
  classes?: string;
  onclick?: (event: MouseEvent) => void;
  onkeyup?: (event: KeyboardEvent) => void;
};

Internal Dependencies

This component uses the following library components internally:

  • Button (for the action button)
  • Img (for the status icon)

Web Component

Tag: <sui-status>

<sui-status
  status-icon="/icon.svg"
  status-icon-alt="Payment confirmed"
  status-text="Success"
  status-description="Operation completed."
></sui-status>

Web Component Events

onbuttonclick (set via buttonProperties, see ButtonProperties) is available as a JS property, and the same click also dispatches a buttonclick DOM custom event (bubbles, composed) for a consumer who only calls addEventListener. detail is the underlying click's MouseEvent — onbuttonclick is wired straight into the action button's own onclick, so it runs with that event rather than with no arguments:

const status = document.querySelector('sui-status');
status.buttonProperties = { text: 'Retry' };
status.addEventListener('buttonclick', (e) => console.log(e.detail.target));

Slots

Slot Name Maps to Snippet Description
icon icon Replaces the status icon. Falls back to the Img resolved from status-icon/status-icon-alt when empty.
description-snippet descriptionSnippet Replaces the plain status-description text with custom markup. Falls back to that attribute when the slot is empty.