<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-status-bar/ in the magma monorepo (usage/*.md and the
  component's JSDoc). Regenerated on every stencil build (scripts/component-docs.ts).
-->

# mds-status-bar

> `@maggioli-design-system/magma` 2.15.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.

The `<mds-status-bar>` web component is a persistent action bar of the Magma Design System that docks a small set of actions (typically `mds-button` elements) to an edge of the viewport, accompanied by an optional descriptive label. It is built on top of `<mds-modal>`, reusing its positioning and overflow handling without rendering a dismissable dialog.

#### Semantic Behavior

- **Floating surface**: The bar floats over content without a blocking overlay.
- **Visibility control**: The bar shows only while `visible` is truthy; the exposed `hide()` method resets it to hidden.
- **Overflow delegation**: The `overflow` prop governs whether body scrolling is locked while the bar is shown.
- **Default slot is actions**: The default slot is intended for interactive content (recommended: `mds-button`), placed next to the optional description text.
- **Reserves its room**: while the bar is visible, the styles of Magma (`base.css`) end the page above it and keep a field reached with Tab above it (WCAG 2.4.11): the room of its tallest content (one line of description, at most three actions) plus `rhythm/between-fields`, with no script that measures it. A page that scrolls in a box of its own puts `var(--magma-status-bar-room, 0px)` at the end of that box.
- **Its actions keep the rhythm of a row**: `rhythm/inline` apart; on a window of 480px or less, where the bar takes the whole width, they stack under `--magma-container-actions` of the bar (380px), each at the full width, the main action at the bottom (`actions/stacked`).

#### Properties & Visual Configurations

- **`position`** anchors the bar to the bottom of the viewport, choosing the horizontal alignment: `'bottom-left'`, `'bottom'` (centered), or `'bottom-right'` (default).
- **`description`** renders an optional caption beside the slotted actions; omit it when the actions are self-explanatory.

#### Other behavioral props

- **`overflow`** selects how page scrolling is treated while the bar is visible: `'manual'` (default) leaves the body scrollable, `'auto'` locks scroll.
- **`visible`** can be toggled either declaratively via the attribute or imperatively via `hide()`.

## Read next

- [`examples.md`](examples.md) - correct usage, from the most common case
- [`mistakes.md`](mistakes.md) - the wrong forms, each with the right one
- [Storybook](https://magma-design-system.github.io/magma/storybook/?path=/docs/ui-status-bar--docs) - the live examples, in the published Storybook of `main`
- [`conventions.md`](../../../../agents/conventions.md), [`variants.md`](../../../../agents/variants.md), [`mistakes.md`](../../../../agents/mistakes.md) - the rules shared by every component

## Props

| Prop | Attribute | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `description` | `description` | `string \| undefined` | - | Specifies the description near the slotted actions |
| `overflow` | `overflow` | `"auto" \| "manual"` | `'manual'` | Specifies if the component prevents the body from scrolling when modal window is opened |
| `position` | `position` | `"bottom" \| "bottom-left" \| "bottom-right"` | `'bottom-right'` | Specifies the position of the status bar |
| `visible` | `visible` | `boolean \| undefined` | - | Specifies if the component is visible |

## Methods

| Method | Signature | Description |
| --- | --- | --- |
| `hide` | `hide() => Promise<void>` | Hides the status bar. |

## Slots

| Slot | Description |
| --- | --- |
| (default) | Add `HTML elements` or `components`, it is **recommended** to use `mds-button` element. |

## Parts

| Part | Description |
| --- | --- |
| `actions` | Selects the `actions` container element wrapped in shadowDOM. |
| `status-bar` | Selects the `status-bar` window component wrapped in shadowDOM. |
| `status-bar-area` | Selects the `status-bar-area` which wraps `status-bar` element with darker area in shadowDOM. |

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-status-bar-max-width` | Maximum width of the status bar. |

Only these are public. Its other 2 are internal: they may change in any release, do not set them.

## Dependencies

Uses: `mds-modal`, `mds-text`.
