Skip to content

HorizontalLine

Read as Markdown

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

HorizontalLine uses HorizontalLineProps and HorizontalLineStyle. It rejects children and supplies an allocation-aware default endpoint, making it useful inside declared layout boxes. Stroke targeting respects lineInteractionWidth.

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

Try the Horizontal line live example.

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

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

Related API: HorizontalLine, PibblPrimitiveComponent, HorizontalLineProps, PrimitiveInput, HorizontalLineStyle.

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

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

HorizontalLineProps

HorizontalLineStyle

View source — packages/core/src/lib/components/horizontal-line.ts:126

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

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

/** @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 });

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