# HorizontalLine

```ts
import { HorizontalLine } from "@pibbl/core";
```

`HorizontalLine` uses [`HorizontalLineProps`](/reference/types/elements-components/#horizontallineprops) and [`HorizontalLineStyle`](/reference/types/styles/#horizontallinestyle). It
rejects children and supplies an allocation-aware default endpoint, making it
useful inside declared layout boxes. Stroke targeting respects
`lineInteractionWidth`.

```tsx
<HorizontalLine
  style={{ x1: 16, x2: 196, y: 40, stroke: "#334155", strokeWidth: 2 }}
/>
```

Try the [Horizontal line live example](/playground/#/examples/drawing/horizontal-line).

## API details from source

<span id="api-HorizontalLine"></span>

Describes a horizontal-line primitive for JSX or createElement authoring.

```ts
HorizontalLine: PibblPrimitiveComponent<HorizontalLineProps, PrimitiveInput<HorizontalLineProps, HorizontalLineStyle>>
```

Related API: [HorizontalLine](/reference/components/horizontal-line/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [HorizontalLineProps](/reference/types/elements-components/#horizontallineprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [HorizontalLineStyle](/reference/types/styles/#horizontallinestyle).

### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

### See also

[HorizontalLineProps](/reference/types/elements-components/#horizontallineprops)

[HorizontalLineStyle](/reference/types/styles/#horizontallinestyle)

[View source — packages/core/src/lib/components/horizontal-line.ts:126](/source/packages/core/src/lib/components/horizontal-line-ts/#L126)

## Implementation guidance for agents

Read the [Drawing, layout, and effects companion](/agents/topics/layout/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal example

Compile this TSX module with `jsx: "react-jsx"` and `jsxImportSource: "@pibbl/core"`, then load it from a browser entry point after the document body exists. It creates and mounts one canvas; dispose the controller before removing or replacing that canvas. The interactive study linked below adds controls beyond this minimal use case.

[Download source](/minimal/horizontal-line.tsx)

```tsx
/** @jsxImportSource @pibbl/core */
import { pibbl, HorizontalLine } from '@pibbl/core';

const canvas = document.createElement('canvas');
canvas.width = 320;
canvas.height = 240;
document.body.append(canvas);

const controller = pibbl(canvas, (
<HorizontalLine
  style={{ x1: 16, x2: 196, y: 40, stroke: "#334155", strokeWidth: 2 }}
/>
));

window.addEventListener('pagehide', () => controller.dispose(), { once: true });
```

## Complete minimal examples

- [Lines and authored paths](/minimal-examples/drawing/strokes-paths/): Combine polyline, axis-aligned strokes, mutable geometry, and SVG path data. [Plain source](/minimal/drawing/strokes-paths.tsx)
## Interactive examples

- [Horizontal line](/examples/horizontal-line/) · [Full page](/experience/horizontal-line/)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
