import { Banner, Button } from "@replicas/ui";

export default function BannerDemo() {
  return (
    <Banner.Root variant="info" style={{ width: "100%", maxWidth: 520 }}>
      <Banner.Icon>
        <svg viewBox="0 0 16 16" fill="none" aria-hidden>
          <circle cx="8" cy="8" r="6.25" stroke="currentColor" strokeWidth="1.5" />
          <path d="M8 7.25v3.5M8 5.25v.01" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
        </svg>
      </Banner.Icon>
      <Banner.Content>
        <Banner.Title>Scheduled maintenance</Banner.Title>
        <Banner.Description>Sync will pause for ten minutes on Sunday at 02:00 UTC.</Banner.Description>
      </Banner.Content>
      <Banner.Actions>
        <Button size="small">Details</Button>
      </Banner.Actions>
    </Banner.Root>
  );
}

Examples

Variants

Green

Your workspace settings were updated.

Red

Your workspace settings were updated.

Orange

Your workspace settings were updated.

Blue

Your workspace settings were updated.

Grey

Your workspace settings were updated.

White

Your workspace settings were updated.

<Banner.Root variant="green">
  <Banner.Content>
    <Banner.Title>Green</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>
<Banner.Root variant="red">
  <Banner.Content>
    <Banner.Title>Red</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>
<Banner.Root variant="orange">
  <Banner.Content>
    <Banner.Title>Orange</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>
<Banner.Root variant="blue">
  <Banner.Content>
    <Banner.Title>Blue</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>
<Banner.Root variant="grey">
  <Banner.Content>
    <Banner.Title>Grey</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>
<Banner.Root variant="white">
  <Banner.Content>
    <Banner.Title>White</Banner.Title>
    <Banner.Description>Your workspace settings were updated.</Banner.Description>
  </Banner.Content>
</Banner.Root>

With Actions

function WithActions() {
  return (
    <Banner.Root variant="warning" style={{ width: "100%" }}>
      <Banner.Content>
        <Banner.Title>Your trial ends in 3 days</Banner.Title>
        <Banner.Description>Upgrade to keep unlimited storage and integrations.</Banner.Description>
      </Banner.Content>
      <Banner.Actions>
        <Button size="small" variant="ghost">
          Later
        </Button>
        <Button size="small" variant="primary">
          Upgrade
        </Button>
      </Banner.Actions>
    </Banner.Root>
  );
}

Title Only

Changes saved

function TitleOnly() {
  return (
    <Banner.Root variant="success" style={{ width: "100%" }}>
      <Banner.Content>
        <Banner.Title>Changes saved</Banner.Title>
      </Banner.Content>
    </Banner.Root>
  );
}

Prompt

Copy Prompt hands your agent everything it needs to build the Banner in the Palermo style: the measured tokens, the CSS and the structure.

Show Prompt
# Palermo Banner

An inline message that calls attention to information, success, warnings or errors.

Build a Banner in this project that looks and behaves like Palermo's. Measured from the running Palermo app (palermo.tryprofound.com). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Partly measured from Palermo's Banner. No reference has been captured yet.

## Variants

- `variant`: `green`, `red`, `orange`, `blue`, `grey`, `white`

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--color-bg-primary` | `#fff` | `#171615` |
| `--color-bg-secondary` | `#fafafa` | `#1e1d1c` |
| `--color-fill-secondary` | `#969696` | `#75736f` |
| `--color-fill-quaternary` | `#e8e8e8` | `#232221` |
| `--color-red-base` | `lab(55.4814% 75.0732 48.8528)` | `lab(63.7053% 60.745 31.3109)` |
| `--color-red-border` | `lab(93.339% 8.68222 3.21964)` | `lab(28.5139% 44.5539 29.0463 / 0.2)` |
| `--color-red-muted-fill` | `lab(96.5005% 4.18508 1.52328)` | `lab(13.003% 29.04 16.7519 / 0.7)` |
| `--color-blue-base` | `lab(54.1736% 13.3369 -74.6839)` | `lab(65.0361% -1.42065 -56.9802)` |
| `--color-blue-border` | `lab(93.2041% -2.0456 -10.1975)` | `lab(24.2277% 11.2876 -48.8024)` |
| `--color-blue-muted-fill` | `lab(96.492% -1.14644 -5.11479)` | `lab(15.6723% 8.86232 -32.2945 / 0.7)` |
| `--color-green-base` | `lab(58.9235% -53.5841 39.2432)` | `lab(78.503% -64.9265 39.7492)` |
| `--color-green-border` | `lab(92.4333% -19.1593 8.97962)` | `lab(30.797% -29.6927 17.382 / 0.4)` |
| `--color-green-muted-fill` | `lab(96.7584% -9.1463 4.70679)` | `lab(15.6845% -20.4225 11.7249 / 0.7)` |
| `--color-orange-base` | `lab(64.272% 57.1788 90.3583)` | `lab(70.0429% 42.5156 75.8207)` |
| `--color-orange-border` | `lab(91.6536% 3.7919 14.6801)` | `lab(30.2951% 36.0434 37.671 / 0.2)` |
| `--color-orange-muted-fill` | `lab(97.7008% 1.53735 5.90649)` | `lab(14.1747% 23.4515 19.4461 / 0.7)` |
| `--text-primary` | `#18181a` | `#ecebe9` |
| `--text-secondary` | `#787878` | `#aaa8a5` |
| `--font-size-mini` | `0.75rem` | `0.75rem` |
| `--font-size-small` | `0.8125rem` | `0.8125rem` |
| `--line-height-mini` | `16px` | `16px` |
| `--line-height-small` | `18px` | `18px` |
| `--font-weight-medium` | `500` | `500` |
| `--radius-6` | `6px` | `6px` |

## CSS

Scoped under `[data-style="palermo"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="palermo"] {
  .ui-banner {
    --banner-icon: var(--color-fill-secondary);
    --banner-description: var(--text-secondary);
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--color-fill-quaternary);
    border-radius: var(--radius-6);
    background-color: var(--color-bg-secondary);
    color: var(--text-primary);
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);

    &:not(:has(.ui-banner-description)) {
      align-items: center;
    }
  }

  .ui-banner:is([data-variant="green"], [data-variant="success"]) {
    --banner-icon: var(--color-green-base);
    --banner-description: color-mix(in srgb, var(--text-primary) 70%, transparent);
    border-color: var(--color-green-border);
    background-color: color-mix(in srgb, var(--color-green-muted-fill) 50%, transparent);
  }

  .ui-banner:is([data-variant="blue"], [data-variant="info"]) {
    --banner-icon: var(--color-blue-base);
    --banner-description: color-mix(in srgb, var(--text-primary) 70%, transparent);
    border-color: var(--color-blue-border);
    background-color: var(--color-blue-muted-fill);
  }

  .ui-banner:is([data-variant="orange"], [data-variant="warning"]) {
    --banner-icon: var(--color-orange-base);
    --banner-description: color-mix(in srgb, var(--text-primary) 70%, transparent);
    border-color: var(--color-orange-border);
    background-color: var(--color-orange-muted-fill);
  }

  .ui-banner:is([data-variant="red"], [data-variant="error"]) {
    --banner-icon: var(--color-red-base);
    --banner-description: color-mix(in srgb, var(--text-primary) 70%, transparent);
    border-color: var(--color-red-border);
    background-color: var(--color-red-muted-fill);
  }

  .ui-banner[data-variant="white"] {
    background-color: var(--color-bg-primary);
  }

  .ui-banner-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    height: 1lh;
    color: var(--banner-icon);

    & svg {
      width: 16px;
      height: 16px;
    }
  }

  .ui-banner-content {
    flex: 1;
    min-width: 0;
  }

  .ui-banner-title {
    margin: 0;
    font-weight: var(--font-weight-medium);
  }

  .ui-banner-description {
    margin: 2px 0 0;
    color: var(--banner-description);
  }

  .ui-banner-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    align-self: center;
    gap: 8px;

    & .ui-button {
      min-height: 24px;
      font-size: var(--font-size-mini);
      line-height: var(--line-height-mini);
    }
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps } from "react";
import { join } from "./utils";

type RootProps = ComponentProps<"div"> & {
  variant?: string;
};

function Root({ className, variant = "info", role, ...props }: RootProps) {
  const urgent = variant === "error" || variant === "danger" || variant === "warning";
  return (
    <div
      role={role ?? (urgent ? "alert" : "status")}
      className={join("ui-banner", className)}
      data-variant={variant}
      {...props}
    />
  );
}

const part = (name: string) =>
  function Part({ className, ...props }: ComponentProps<"div">) {
    return <div className={join(`ui-banner-${name}`, className)} {...props} />;
  };

function Title({ className, ...props }: ComponentProps<"p">) {
  return <p className={join("ui-banner-title", className)} {...props} />;
}

function Description({ className, ...props }: ComponentProps<"p">) {
  return <p className={join("ui-banner-description", className)} {...props} />;
}

export const Banner = {
  Root,
  Icon: part("icon"),
  Content: part("content"),
  Title,
  Description,
  Actions: part("actions"),
};
```

## Example

```tsx
import { Banner, Button } from "@replicas/ui";

export default function BannerDemo() {
  return (
    <Banner.Root variant="info" style={{ width: "100%", maxWidth: 520 }}>
      <Banner.Icon>
        <svg viewBox="0 0 16 16" fill="none" aria-hidden>
          <circle cx="8" cy="8" r="6.25" stroke="currentColor" strokeWidth="1.5" />
          <path d="M8 7.25v3.5M8 5.25v.01" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
        </svg>
      </Banner.Icon>
      <Banner.Content>
        <Banner.Title>Scheduled maintenance</Banner.Title>
        <Banner.Description>Sync will pause for ten minutes on Sunday at 02:00 UTC.</Banner.Description>
      </Banner.Content>
      <Banner.Actions>
        <Button size="small">Details</Button>
      </Banner.Actions>
    </Banner.Root>
  );
}
```

## Foundations

The rest of the Palermo style, as a skill: https://replicas.raphaelsalaja.com/skills/palermo/SKILL.md