# `LedgerUI.Components.ScrollArea`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/components/scroll_area.ex#L1)

A box that scrolls with a thin scrollbar (6px, transparent track). For long menus, lists in a
card, the body of a panel. The height comes from `class` or an inline `style`.

    <.scroll_area style="max-height:16rem">...</.scroll_area>
    <.scroll_area focusable label="Release notes" style="max-height:16rem">...</.scroll_area>

`stick_bottom` keeps a list that grows at its end (a chat) scrolled to its last item, unless the
reader scrolled up: it mounts the `LedgerUI.ScrollBottom` hook (needs a stable `id`).

## `variant`

  * `"plain"` (default): the bare scrolling box (`lu-scroll-area`).
  * `"panel"`: the canvas card (`lu-panel`) that scrolls: border, background and radius of a panel.
  * `"preview"`: the canvas picture of a scroll area (`lu-sa`): a frame that clips the content and
    draws the scrollbar thumb (`bar` for vertical, `barx` for horizontal, animated) according to
    `orientation`; `scrollbar` `hover` / `hidden` add the class of the same name. The content is
    whatever the slot holds (the canvas wraps it in an animated `mo-scroll` / `mo-scrollx`). For the
    documentation and the showcase only.

# `scroll_area`

## Attributes

* `variant` (`:string`) - Defaults to `"plain"`. Must be one of `"plain"`, `"panel"`, or `"preview"`.
* `orientation` (`:string`) - Defaults to `"vertical"`. Must be one of `"both"`, `"horizontal"`, or `"vertical"`.
* `scrollbar` (`:string`) - Defaults to `"hover"`. Must be one of `"always"`, `"hidden"`, or `"hover"`.
* `focusable` (`:boolean`) - Defaults to `false`.
* `label` (`:string`) - Defaults to `nil`.
* `id` (`:string`) - Defaults to `nil`.
* `stick_bottom` (`:boolean`) - Defaults to `false`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.
## Slots

* `inner_block` (required)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
