Atlassian Design System JS behaviour

Flag

Corner toast with a square colored icon, title, body and dismiss — the instantly recognizable Jira feedback pattern.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

The toast Jira taught the world

Publish the release for a success flag with a six-second countdown and a working Undo — or cut the connection and meet the error flag that waits.

NABU-241Payment webhook

Ready to ship 2 reactions

The flag lands in the stage corner — inside the app frame, never over the whole page. Escape dismisses.

The four appearances

The square icon carries the severity: blue informs, green celebrates, yellow cautions, red stops you.

Information

Two teammates joined the project today.

info
Success

Sprint 24 closed with 41 of 44 items done.

success
Warning

Capacity for next sprint is over by 12 hours.

warning
Error

Two builds failed on the release branch.

error

Important props

Important props
Prop Type Default What it does
appearance string 'information' Sets the square icon’s colour: blue, green, yellow, red.
title string '' The semibold headline; a summary of what happened.
actions slot null The action link, like «Undo», under the body.
autoDismiss seconds '8' Leaves by itself after 8s; errors wait.

Snippet

<div class="atfl" role="status">
    <span class="atfl-icon" data-tone="success" aria-hidden="true">✓</span>
    <div>
        <h4>Changes shipped</h4>
        <p>Version 2.4 is now visible to every teammate.</p>
        <button class="atfl-action">Undo</button>
    </div>
    <button class="atfl-close" aria-label="Dismiss">×</button>
</div>

<style>
.atfl { display: flex; gap: 12px; inline-size: 368px; max-inline-size: 100%;
        padding: 12px; border-radius: 4px; background: #FFFFFF;
        box-shadow: 0 8px 12px #091E4229, 0 0 1px #091E4240; }
.atfl-icon { flex: none; display: grid; place-items: center; inline-size: 20px;
             aspect-ratio: 1; border-radius: 2px; background: #1F845A; color: #fff; }
.atfl h4 { margin: 0; font: 600 14px Inter, system-ui; color: #172B4D; }
.atfl p { margin: 2px 0 4px; font: 400 12px/1.6 Inter, system-ui; color: #44546F; }
.atfl-close { margin-inline-start: auto; align-self: flex-start; border: none;
              background: none; color: #626F86; }
</style>
// app/Pages/Release.jsx — Inertia page; renders the React snippet
// below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import ReleaseFlag from '@/components/ReleaseFlag';

export default function Release() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <ReleaseFlag />
      </main>
    </NabuXUIProvider>
  );
}
// ReleaseFlag.jsx — the Atlassian flag: success auto-dismisses, errors wait
import { useEffect, useRef, useState } from 'react';
import '@nabuxai/ui-core/css';

export default function ReleaseFlag() {
  const [flag, setFlag] = useState(null); // null | 'success' | 'error'
  const timer = useRef(null);

  // Errors stay until dismissed; the rest leave on their own timer.
  const show = (kind, wait) => {
    clearTimeout(timer.current);
    setFlag(kind);
    if (wait) timer.current = setTimeout(() => setFlag(null), 6000);
  };
  useEffect(() => () => clearTimeout(timer.current), []);

  return (
    <>
      <style>{`
        .atfl-stage { position: relative; display: grid; gap: .9rem; align-content: start;
                      max-inline-size: 26rem; min-block-size: 14rem; padding: 1.25rem;
                      border: 1px solid #DFE1E6; border-radius: 6px; background: #F7F8F9;
                      font-family: Inter, system-ui, sans-serif; }
        .atfl-btn { block-size: 2rem; padding-inline: .8rem; justify-self: start; border: none;
                    border-radius: 3px; cursor: pointer; background: #0C66E4; color: #fff;
                    font: 500 .8rem/1 Inter, system-ui; }
        /* Flags stack at the stage corner, like Atlaskit's flag group. */
        .atfl { position: absolute; inset-inline: 1rem; inset-block-end: 1rem; display: flex; gap: .75rem;
                padding: .8rem .9rem; border-radius: 4px; background: #fff; text-align: start;
                box-shadow: 0 8px 12px rgba(9, 30, 66, .16), 0 0 1px rgba(9, 30, 66, .25); }
        .atfl-ic { flex: none; display: grid; place-items: center; inline-size: 1.25rem; aspect-ratio: 1;
                   border-radius: 2px; color: #fff; font: 700 .8rem/1 Inter, system-ui; }
        .atfl-body { flex: 1; }
        .atfl-body h5 { margin: 0; font: 600 .82rem/1.4 Inter, system-ui; color: #172B4D; }
        .atfl-body p { margin: .15rem 0 .35rem; font: 400 .76rem/1.55 Inter, system-ui; color: #44546F; }
        .atfl-body button { border: none; background: none; padding: 0; cursor: pointer;
                            font: 600 .76rem Inter, system-ui; color: #0C66E4; }
        .atfl-x { border: none; background: none; cursor: pointer; color: #626F86; }
      `}</style>
      <div className="atfl-stage">
        <button type="button" className="atfl-btn" onClick={() => show('success', true)}>
          Publish release 2.4
        </button>
        <button type="button" className="atfl-btn" style={{ background: '#F1F2F4', color: '#172B4D' }}
          onClick={() => show('error', false)}>
          Simulate offline publish
        </button>
        {flag && (
          <div className="atfl" role="status">
            <span className="atfl-ic" aria-hidden="true"
              style={{ background: flag === 'success' ? '#1F845A' : '#B40000' }}>
              {flag === 'success' ? '✓' : '!'}
            </span>
            <div className="atfl-body">
              <h5>{flag === 'success' ? 'Version 2.4 shipped' : 'Release failed — you are offline'}</h5>
              <p>{flag === 'success'
                ? 'Live for every teammate on web and mobile.'
                : 'The build is safe; we will not half-publish it.'}</p>
              {flag === 'success'
                ? <button type="button" onClick={() => setFlag(null)}>Undo</button>
                : <button type="button" onClick={() => show('success', true)}>Retry</button>}
            </div>
            <button type="button" className="atfl-x" aria-label="Dismiss" onClick={() => setFlag(null)}>×</button>
          </div>
        )}
      </div>
    </>
  );
}
<!-- ReleaseFlag.vue — the Atlassian flag: success auto-dismisses, errors wait -->
<script setup lang="ts">
import { onBeforeUnmount, ref } from 'vue';
import '@nabuxai/ui-core/css';

const flag = ref<'success' | 'error' | null>(null);
let timer: ReturnType<typeof setTimeout> | undefined;

// Errors stay until dismissed; the rest leave on their own timer.
function show(kind: 'success' | 'error', wait: boolean) {
  clearTimeout(timer);
  flag.value = kind;
  if (wait) timer = setTimeout(() => (flag.value = null), 6000);
}
onBeforeUnmount(() => clearTimeout(timer));
</script>

<template>
  <div class="atfl-stage">
    <button type="button" class="atfl-btn" @click="show('success', true)">Publish release 2.4</button>
    <button type="button" class="atfl-btn" style="background: #F1F2F4; color: #172B4D"
      @click="show('error', false)">Simulate offline publish</button>
    <div v-if="flag" class="atfl" role="status">
      <span class="atfl-ic" aria-hidden="true"
        :style="{ background: flag === 'success' ? '#1F845A' : '#B40000' }">
        {{ flag === 'success' ? '✓' : '!' }}
      </span>
      <div class="atfl-body">
        <h5>{{ flag === 'success' ? 'Version 2.4 shipped' : 'Release failed — you are offline' }}</h5>
        <p>{{ flag === 'success'
          ? 'Live for every teammate on web and mobile.'
          : 'The build is safe; we will not half-publish it.' }}</p>
        <button v-if="flag === 'success'" type="button" @click="flag = null">Undo</button>
        <button v-else type="button" @click="show('success', true)">Retry</button>
      </div>
      <button type="button" class="atfl-x" aria-label="Dismiss" @click="flag = null">×</button>
    </div>
  </div>
</template>

<style scoped>
.atfl-stage { position: relative; display: grid; gap: .9rem; align-content: start;
              max-inline-size: 26rem; min-block-size: 14rem; padding: 1.25rem;
              border: 1px solid #DFE1E6; border-radius: 6px; background: #F7F8F9;
              font-family: Inter, system-ui, sans-serif; }
.atfl-btn { block-size: 2rem; padding-inline: .8rem; justify-self: start; border: none;
            border-radius: 3px; cursor: pointer; background: #0C66E4; color: #fff;
            font: 500 .8rem/1 Inter, system-ui; }
/* Flags stack at the stage corner, like Atlaskit's flag group. */
.atfl { position: absolute; inset-inline: 1rem; inset-block-end: 1rem; display: flex; gap: .75rem;
        padding: .8rem .9rem; border-radius: 4px; background: #fff; text-align: start;
        box-shadow: 0 8px 12px rgba(9, 30, 66, .16), 0 0 1px rgba(9, 30, 66, .25); }
.atfl-ic { flex: none; display: grid; place-items: center; inline-size: 1.25rem; aspect-ratio: 1;
           border-radius: 2px; color: #fff; font: 700 .8rem/1 Inter, system-ui; }
.atfl-body { flex: 1; }
.atfl-body h5 { margin: 0; font: 600 .82rem/1.4 Inter, system-ui; color: #172B4D; }
.atfl-body p { margin: .15rem 0 .35rem; font: 400 .76rem/1.55 Inter, system-ui; color: #44546F; }
.atfl-body button { border: none; background: none; padding: 0; cursor: pointer;
                    font: 600 .76rem Inter, system-ui; color: #0C66E4; }
.atfl-x { border: none; background: none; cursor: pointer; color: #626F86; }
</style>
<!-- ReleaseFlag.svelte — the Atlassian flag: success auto-dismisses, errors wait -->
<script lang="ts">
  import { onMount } from 'svelte';
  import '@nabuxai/ui-core/css';

  let flag = $state<'success' | 'error' | null>(null);
  let timer: ReturnType<typeof setTimeout> | undefined;

  // Errors stay until dismissed; the rest leave on their own timer.
  function show(kind: 'success' | 'error', wait: boolean) {
    clearTimeout(timer);
    flag = kind;
    if (wait) timer = setTimeout(() => (flag = null), 6000);
  }
  onMount(() => () => clearTimeout(timer));
</script>

<div class="atfl-stage">
  <button type="button" class="atfl-btn" onclick={() => show('success', true)}>Publish release 2.4</button>
  <button type="button" class="atfl-btn" style="background: #F1F2F4; color: #172B4D"
    onclick={() => show('error', false)}>Simulate offline publish</button>
  {#if flag}
    <div class="atfl" role="status">
      <span class="atfl-ic" aria-hidden="true"
        style:background={flag === 'success' ? '#1F845A' : '#B40000'}>
        {flag === 'success' ? '✓' : '!'}
      </span>
      <div class="atfl-body">
        <h5>{flag === 'success' ? 'Version 2.4 shipped' : 'Release failed — you are offline'}</h5>
        <p>{flag === 'success'
          ? 'Live for every teammate on web and mobile.'
          : 'The build is safe; we will not half-publish it.'}</p>
        {#if flag === 'success'}
          <button type="button" onclick={() => (flag = null)}>Undo</button>
        {:else}
          <button type="button" onclick={() => show('success', true)}>Retry</button>
        {/if}
      </div>
      <button type="button" class="atfl-x" aria-label="Dismiss" onclick={() => (flag = null)}>×</button>
    </div>
  {/if}
</div>

<style>
.atfl-stage { position: relative; display: grid; gap: .9rem; align-content: start;
              max-inline-size: 26rem; min-block-size: 14rem; padding: 1.25rem;
              border: 1px solid #DFE1E6; border-radius: 6px; background: #F7F8F9;
              font-family: Inter, system-ui, sans-serif; }
.atfl-btn { block-size: 2rem; padding-inline: .8rem; justify-self: start; border: none;
            border-radius: 3px; cursor: pointer; background: #0C66E4; color: #fff;
            font: 500 .8rem/1 Inter, system-ui; }
/* Flags stack at the stage corner, like Atlaskit's flag group. */
.atfl { position: absolute; inset-inline: 1rem; inset-block-end: 1rem; display: flex; gap: .75rem;
        padding: .8rem .9rem; border-radius: 4px; background: #fff; text-align: start;
        box-shadow: 0 8px 12px rgba(9, 30, 66, .16), 0 0 1px rgba(9, 30, 66, .25); }
.atfl-ic { flex: none; display: grid; place-items: center; inline-size: 1.25rem; aspect-ratio: 1;
           border-radius: 2px; color: #fff; font: 700 .8rem/1 Inter, system-ui; }
.atfl-body { flex: 1; }
.atfl-body h5 { margin: 0; font: 600 .82rem/1.4 Inter, system-ui; color: #172B4D; }
.atfl-body p { margin: .15rem 0 .35rem; font: 400 .76rem/1.55 Inter, system-ui; color: #44546F; }
.atfl-body button { border: none; background: none; padding: 0; cursor: pointer;
                    font: 600 .76rem Inter, system-ui; color: #0C66E4; }
.atfl-x { border: none; background: none; cursor: pointer; color: #626F86; }
</style>