A circle with a text slot. The component does not define what goes in the slot.
import { Port } from "@bbox-ui/core";
export function PortDemo() {
return (
<div className="flex flex-wrap items-center justify-center gap-12 py-10">
<Port state="empty" size="md" textLayout="bot">empty</Port>
<Port state="default" size="md" textLayout="bot">default</Port>
<Port state="wired" size="md" textLayout="bot">wired</Port>
<Port state="received" size="md" textLayout="bot">received</Port>
</div>
);
}
pnpm dlx shadcn@latest add zacharyyamaoka/bbox-ui/portempty (hollow ring), default (filled neutral), wired (accent dot inside the ring), and received, a runtime flag that is never persisted as document state.import { Port } from "@/components/bbox/port";<Port state="wired" size="md" textLayout="right">image</Port>Where the slot sits relative to the dot. The -offset variants push the label
further out, for a dot painted on a block's boundary.
import { Port } from "@bbox-ui/core";
export function PortLayouts() {
return (
<div className="flex flex-wrap items-center justify-center gap-x-16 gap-y-10 py-10">
<Port state="wired" textLayout="top">top</Port>
<Port state="wired" textLayout="bot">bot</Port>
<Port state="wired" textLayout="right">right</Port>
<Port state="wired" textLayout="left">left</Port>
</div>
);
}
import { Port } from "@bbox-ui/core";
export function PortSizes() {
return (
<div className="flex flex-wrap items-end justify-center gap-12 py-10">
<Port state="wired" size="sm" textLayout="bot">sm 14</Port>
<Port state="wired" size="md" textLayout="bot">md 25</Port>
<Port state="wired" size="lg" textLayout="bot">lg 36</Port>
</div>
);
}
| Prop | Type | Default |
|---|---|---|
| state | "empty" | "default" | "wired" | "received" | "empty" |
| size | "sm" | "md" | "lg" | "md" |
| textLayout | "top" | "bot" | "right" | "left" | "right-offset" | "left-offset" | "right" |
| textSize | "md" | "lg" | "xl" | "md" |