> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Banner

> Conținut de feedback cu stare, aspect și paletă independente.

## Prezentare generală

`Banner` aranjează conținutul furnizat de apelant, un nod `icon` opțional și un nod `action` opțional. `status` descrie semnificația feedbackului: `neutral`, `info`, `success`, `warning` sau `error`. `variant` selectează aspectul `solid` sau `soft`. Un `color` explicit suprascrie paleta de stare fără a-i modifica semnificația.

Valorile implicite sunt `status="info"` și `variant="solid"`. Paletele de stare implicite sunt, respectiv, gri, albastru, verde, portocaliu și roșu.

**Light**

[Exemplu de banner (light)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--display\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Exemplu de banner (dark)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--display\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-feedback-banner--display)

## Utilizare

```tsx theme={null}
import { Banner } from 'twenty-ui/primitives/feedback';

export const SyncBanner = () => (
  <Banner status="info" variant="solid">
    Contact sync is temporarily paused. Your saved records remain available.
  </Banner>
);
```

## Acțiuni și aspect

**Light**

[Palete și variante de feedback pentru bannere (light)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--catalog\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Palete și variante de feedback pentru bannere (dark)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--catalog\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-feedback-banner--catalog)

```tsx theme={null}
import { Banner } from 'twenty-ui/primitives/feedback';
import { IconInfoCircle } from 'twenty-ui/icon';

export const SyncBanner = ({ onRetry }: { onRetry: () => void }) => (
  <Banner
    status="error"
    variant="soft"
    color="blue"
    icon={<IconInfoCircle aria-hidden="true" />}
    action={<Banner.Action onClick={onRetry}>Retry sync</Banner.Action>}
  >
    Contact sync could not finish.
  </Banner>
);
```

`Banner.Action` oferă un buton mic cu contur, care moștenește culoarea afișată a bannerului, inclusiv suprascrierile explicite ale paletei și aspectele solide. Acceptă interacțiuni Button, linkuri, ref-uri și redare personalizată. Slotul `action` acceptă și controale arbitrare.

Ținta rădăcină este un `div`. Atributele native, gestionarele de evenimente, `className`, `style` și `ref` se aplică acelei rădăcini. `render` acceptă un element Base UI sau un callback; callbackul primește proprietăți native și ref, plus starea rezolvată pentru `status`, `variant` și `color`. Păstrați proprietățile și ref-ul furnizate atunci când compuneți un alt element.

```tsx theme={null}
import { Banner } from 'twenty-ui/primitives/feedback';

export const SyncResult = () => (
  <Banner
    status="success"
    variant="soft"
    role="status"
    aria-live="polite"
    aria-atomic="true"
    render={<section aria-label="Sync result" />}
  >
    Contacts are up to date.
  </Banner>
);
```

Starea nu atribuie automat `role`, `aria-live` sau anunțuri. Alegeți-le la apelant atunci când actualizările trebuie anunțate. Furnizați nume accesibile pentru controale și marcați nodurile icon decorative cu `aria-hidden`. Apelantul controlează vizibilitatea și închiderea.

## Închidere

Transmiteți `onDismiss` pentru a afișa un control fantomă de închidere de 24 px la capătul logic pe linie. Controlul moștenește culoarea bannerului și are `type="button"`. Valoarea implicită pentru `closeLabel` este `Close`; furnizați text localizat în aplicația dvs. Spațierea echilibrată pe linie păstrează conținutul centrat și acțiunile departe de control.

Apelantul controlează vizibilitatea. Activarea controlului de închidere apelează `onDismiss` și păstrează bannerul montat până când apelantul actualizează starea. Alte acțiuni rămân în slotul `action`.

```tsx theme={null}
import { useState } from 'react';
import { Banner } from 'twenty-ui/primitives/feedback';

export const DismissibleSyncBanner = () => {
  const [isVisible, setIsVisible] = useState(true);

  return isVisible ? (
    <Banner
      onDismiss={() => setIsVisible(false)}
      closeLabel="Dismiss sync message"
    >
      Contacts are syncing in the background.
    </Banner>
  ) : null;
};
```

**Light**

[Banner care poate fi închis (light)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--dismissible\&viewMode=story\&globals=colorScheme:light)

**Dark**

[Banner care poate fi închis (dark)](https://storybook.twenty.com/iframe.html?id=ui-feedback-banner--dismissible\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-feedback-banner--dismissible)

## Migrare

Înlocuiți `variant="primary"` cu `variant="solid"` și `variant="secondary"` cu `variant="soft"`. Înlocuiți `color="danger"` cu `status="error"` sau cu `color="red"` atunci când trebuie modificată doar paleta. Bannerele informative albastre pot utiliza `status="info"`.

## Proprietăți

**action** `ReactNode`

Optional trailing ReactNode. Banner.Action supplies a small outline action that inherits the resolved banner color; arbitrary controls are also accepted.

**children** `ReactNode`

Caller-provided content, including text, links and controls.

**className** `string`

Class merged onto the root div or composed element.

**closeLabel** `string` (default: Close)

Accessible label for the close control. Defaults to Close; supply localized text when needed.

**color** `"blue" | "gray" | "green" | "orange" | "red"` (default: status palette)

Palette override: gray, blue, green, orange or red. When omitted, status selects the corresponding palette.

**icon** `ReactNode`

Optional leading ReactNode. The caller supplies decorative or accessible icon semantics.

**onDismiss** `(() =\> void)`

Renders a 24px ghost close control and calls this callback when activated. The caller owns visibility.

**ref** `Ref\<HTMLDivElement\>`

Ref to the root div, or to the DOM element supplied through render.

**render** `ReactElement\<unknown, string | JSXElementConstructor\<any\>\> | ComponentRenderFn\<HTMLProps, BannerState\>`

Base UI element or render callback. The callback receives native props/ref and resolved status, variant and color state.

**status** `"error" | "info" | "neutral" | "success" | "warning"` (default: info)

Feedback meaning: neutral, info, success, warning or error. Defaults to info. Does not assign a role or live region.

**style** `CSSProperties`

Inline styles applied to the root div or composed element.

**variant** `"soft" | "solid"` (default: solid)

Solid or soft appearance. Defaults to solid, independently of status.

### Banner.Action

**Action.className** `string | ((state: ButtonState) =\> string | undefined)`

CSS class applied to the element, or a function that
returns a class based on the component's state.

**Action.elevated** `boolean`

Adds a shadow and backdrop blur. Neutral outline buttons also use elevated surface colors.

**Action.endIcon** `ReactNode`

Decorative content displayed after the label.

**Action.focusableWhenDisabled** `boolean` (default: false)

Whether the button should be focusable when disabled.

**Action.fullWidth** `boolean`

Expands the button to fill its container width.

**Action.href** `string`

Destination URL. Renders a native anchor when `render` is omitted unless `nativeButton` is explicitly true. Custom renderers retain their own element contract.

**Action.loading** `boolean`

Shows a loading indicator and disables activation.

**Action.loadingPosition** `"center" | "end" | "start"`

Where the loading indicator appears. `center` hides the content while preserving its layout space; `start` and `end` keep children and the opposite icon visible and replace the corresponding icon with the spinner.

**Action.nativeButton** `boolean` (default: true)

Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in `href` anchor defaults to false; an explicit value takes precedence.

**Action.render** `ReactElement\<unknown, string | JSXElementConstructor\<any\>\> | ComponentRenderFn\<HTMLProps, ButtonState\>`

Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use `nativeButton={false}` and `role="link"` for a custom navigation anchor. Router integration belongs to the caller.

**Action.role** `AriaRole`

Role of the root element. Use `link` for custom navigation renderers.

**Action.shortcut** `ShortcutDefinition`

Flat key array for simultaneous keys, or nested key arrays for an ordered sequence. Displayed on non-mobile screens.

**Action.shortcutJoinLabel** `string`

Localized text between sequence steps. Defaults to then.

**Action.startIcon** `ReactNode`

Decorative content displayed before the label.

**Action.style** `CSSProperties | ((state: ButtonState) =\> CSSProperties | undefined)`

Style applied to the element, or a function that
returns a style object based on the component's state.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.