fumadocs-ui
Version:
The Radix UI version of Fumadocs UI
29 lines (27 loc) • 819 B
JavaScript
import { cn } from "@fumadocs/ui/cn";
import { jsx, jsxs } from "react/jsx-runtime";
import { Link } from "lucide-react";
//#region src/components/heading.tsx
function Heading({ as, className, ...props }) {
const As = as ?? "h1";
if (!props.id) return /* @__PURE__ */ jsx(As, {
className,
...props
});
return /* @__PURE__ */ jsxs(As, {
className: cn("flex scroll-m-28 flex-row items-center gap-2", className),
...props,
children: [/* @__PURE__ */ jsx("a", {
"data-card": "",
href: `#${props.id}`,
className: "peer",
children: props.children
}), /* @__PURE__ */ jsx(Link, {
"aria-hidden": true,
className: "size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"
})]
});
}
//#endregion
export { Heading };
//# sourceMappingURL=heading.js.map