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

# mds-input-tip

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

The `<mds-input-tip>` web component is the floating helper container of the Magma Design System input family: it overlays an input field and carries supplementary content (slotted `mds-input-tip-item` chips: status labels, hints, counters) that slides into place when the field becomes active. It is a presentational compound child positioned against its parent input rather than a standalone control.

#### Semantic Behavior

- **Floating overlay**: The tip floats over the parent input's edge without intercepting interaction (`pointer-events: none`, which `mds-input-tip-item` keeps too).
- **Active expansion**: Setting `active` slides a bottom tip onto the edge of the input; clearing it collapses the tip back flush with the input. A top tip stays where it stands, on the top border. It does not expand the items: each `mds-input-tip-item` shows its text only when its own `expanded` is set.
- **On the top border**: A top tip stands on the top border of its field, half outside, so that it never covers the button at the end of the field. It keeps clear of the rounded corner by the radius of the field, which the field passes down to it, plus a margin, and sits on the straight part of the border.
- **Empty collapse**: When the host has no slotted content it is hidden entirely, so an unused tip occupies no space.
- **Default slot is content**: The single default slot carries the tip's arbitrary children; there are no named slots, events, form association, or focus management of its own.

#### Properties & Visual Configurations

- **`active`** drives the expanded vs. collapsed state and is normally toggled by the parent input in response to focus, not set manually.
- **`position`** selects which edge of the input the tip anchors to: `'top'` (default) stands on the top border of the field, half outside, and stays there on focus; `'bottom'` sits inside the bottom edge and slides onto it when `active`.

## 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/form-input-tip--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 |
| --- | --- | --- | --- | --- |
| `active` | `active` | `boolean \| undefined` | `false` | Moves the bottom tip onto the edge of the input, as the parent input does while it has the focus; the top tip stays on the border of the field. It does not expand the items: each `mds-input-tip-item` opens on its own `expanded` |
| `position` | `position` | `"bottom" \| "top" \| undefined` | `'top'` | Specifies the position of the element relative to its container: `top` stands on the top border of the field, half outside, clear of its corner by the radius the field passes down plus a margin; `bottom` sits inside the bottom edge |

## Slots

| Slot | Description |
| --- | --- |
| (default) | Add `mds-input-tip-item` elements or `components` to this slot. |

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-input-tip-background` | Background color of the input tip |

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

## Dependencies

Used by: `mds-input`, `mds-input-date`, `mds-input-select`.
