# Loading line

A thin line at a surface's edge while what is under it loads: a stretch of ink runs across it.

Live variants: https://design.arcadia.is/components/loading-line

```tsx
import { LoadingLine } from "@arcadia/ui";
```

```tsx
import { useState } from "react";
import { Input, IconButton, LoadingLine } from "@arcadia/ui";

function AddressBar() {
  const [busy, setBusy] = useState(true);
  return (
    <div {...sx("cmp-bar", demo.bar)}>
      <IconButton swap icon={busy ? "stop" : "refresh"} label={busy ? "Stop" : "Reload"} size="sm" tone="muted" onClick={() => setBusy(b => !b)} />
      <Input variant="bar" size="sm" aria-label="Address" value="https://example.com/reports" rest="example.com/reports" readOnly rootStyle={demo.field} />
      <LoadingLine active={busy} />
    </div>
  );
}
```

## Accessibility

Hidden from assistive technology unless given a `label`, which makes it a `progressbar` with that name while it runs (no value: it is indeterminate). Omit the label when a control beside it already says so, such as a Reload button that turned into Stop. With reduced motion the stretch holds still across the middle.

## API reference

### LoadingLine

- `active` (`boolean`, required): Runs while true: shown 200ms after it turns on, then held at least 400ms.
- `edge` (`"top" | "bottom"`, default `"bottom"`): The edge of its positioned parent it lies on.
- `label` (`string`): Accessible name while it runs ("Loading"). Omit when nearby text or a control already says so.
- `rootStyle` (`RootStyle<LoadingLineKnobs>`): Typed StyleX override: layout and the `--loading-line-*` knobs.

Rest props go to `<span>` props and `render`.
