Edge Label
Inline edge label for relationship semantics such as streams, handoffs, or policies. Install Edge Label from the VLLNT UI registry with the shadcn CLI.
What it is and when to use
Edge Label is a small pill-shaped tag for annotating the connection between two nodes — the kind of label you place on an edge in a graph, flow, or pipeline to name a stream, handoff, or policy. It renders as an inline, uppercase, letter-spaced badge and takes an emphasis prop with two levels: subtle for muted resting labels and active for a highlighted sky-toned state. It forwards every native span prop for positioning.
OverlayInline edge label for relationship semantics such as streams, handoffs, or policies. Part of the overlay family in VLLNT UI, it ships as a machine-readable registry entry — copy the source directly into your app with the shadcn CLI and own it, no runtime dependency on a component library.
Preview
Switch between light and dark to inspect the embedded Storybook preview.
Installation
Add Edge Label to your project with the shadcn CLI. The source lands in your codebase, ready to adapt:
pnpm dlx shadcn@latest add https://ui.vllnt.com/r/edge-label.jsonSource
import { cn } from "../../lib/utils";
export type EdgeLabelProps = React.ComponentPropsWithoutRef<"span"> & {
emphasis?: "active" | "subtle";
};
const emphasisClasses: Record<
NonNullable<EdgeLabelProps["emphasis"]>,
string
> = {
active: "border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",
subtle: "border-border/60 bg-background/90 text-muted-foreground",
};
const EdgeLabel = ({
className,
emphasis = "subtle",
ref,
...props
}: EdgeLabelProps & { ref?: React.Ref<HTMLSpanElement> }) => (
<span
className={cn(
"inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.18em] shadow-sm",
emphasisClasses[emphasis],
className,
)}
data-emphasis={emphasis}
ref={ref}
{...props}
/>
);
EdgeLabel.displayName = "EdgeLabel";
export { EdgeLabel };
Stories
Explore every variant and state in the interactive Storybook:
Preview
Switch between light and dark to inspect the embedded Storybook preview.
FAQ
- What is Edge Label?
- Edge Label is a React component that renders a small uppercase pill used to label the relationship on a graph edge or flow connector, such as a stream, handoff, or policy.
- How do I add Edge Label to my app?
- Run `pnpm dlx shadcn@latest add https://ui.vllnt.com/r/edge-label.json`, then render `<EdgeLabel emphasis="active">stream</EdgeLabel>` and position it over your edge.
- What emphasis styles does Edge Label support?
- Two, via the `emphasis` prop: `subtle` (the default) renders a muted, bordered label, and `active` renders a highlighted sky-colored label. The chosen value is also exposed as a `data-emphasis` attribute for styling.