node-header
simple-ai/node-headerFreeComponent
simple-ai publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://simple-ai.dev/r/node-header.jsonSource
1import { Slot } from "@radix-ui/react-slot";2import { EllipsisVertical } from "lucide-react";3import React, { type ComponentProps } from "react";4import { Button } from "@/components/ui/button";5import {6 DropdownMenu,7 DropdownMenuContent,8 DropdownMenuTrigger,9} from "@/components/ui/dropdown-menu";10import { cn } from "@/lib/utils";1112/* NODE HEADER -------------------------------------------------------------- */1314export type NodeHeaderProps = React.HTMLAttributes<HTMLElement>;1516/**17 * A container for a consistent header layout intended to be used inside the18 * `<BaseNode />` component.19 */20export const NodeHeader = React.forwardRef<HTMLElement, NodeHeaderProps>(21 ({ className, ...props }, ref) => {22 return (23 <header24 ref={ref}25 {...props}26 className={cn(27 "mb-4 flex items-center justify-between gap-2 px-3 py-2",28 // Remove or modify these classes if you modify the padding in the29 // `<BaseNode />` component.30 "-mx-5 -mt-5",31 className,32 )}33 />34 );35 },36);3738NodeHeader.displayName = "NodeHeader";3940/* NODE HEADER TITLE -------------------------------------------------------- */4142export interface NodeHeaderTitleProps43 extends React.HTMLAttributes<HTMLHeadingElement> {44 asChild?: boolean;45}4647/**48 * The title text for the node. To maintain a native application feel, the title49 * text is not selectable.50 */51export const NodeHeaderTitle = React.forwardRef<52 HTMLHeadingElement,53 NodeHeaderTitleProps54>(({ className, asChild, ...props }, ref) => {55 const Comp = asChild ? Slot : "h3";5657 return (58 <Comp59 ref={ref}60 {...props}61 className={cn(className, "user-select-none flex-1 font-semibold")}62 />63 );64});6566NodeHeaderTitle.displayName = "NodeHeaderTitle";6768/* NODE HEADER ICON --------------------------------------------------------- */6970export type NodeHeaderIconProps = React.HTMLAttributes<HTMLSpanElement>;7172export const NodeHeaderIcon = React.forwardRef<73 HTMLSpanElement,74 NodeHeaderIconProps75>(({ className, ...props }, ref) => {76 return (77 <span ref={ref} {...props} className={cn(className, "[&>*]:size-5")} />78 );79});8081NodeHeaderIcon.displayName = "NodeHeaderIcon";8283/* NODE HEADER ACTIONS ------------------------------------------------------ */8485export type NodeHeaderActionsProps = React.HTMLAttributes<HTMLDivElement>;8687/**88 * A container for right-aligned action buttons in the node header.89 */90export const NodeHeaderActions = React.forwardRef<91 HTMLDivElement,92 NodeHeaderActionsProps93// … truncated
What it pulls in
Other registry items
Files it writes
More from simple-ai
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| base-handlebase-handle | simple-ai | Components | Free | 1 dep | |
| base-nodebase-node | simple-ai | Components | Free | no deps | |
| Chat Inputchat-input | simple-ai | Components | Free | 7 deps | |
| Chat Messagechat-message | simple-ai | Components | Free | no deps | |
| Chat Message Areachat-message-area | simple-ai | Components | Free | 1 dep | |
| Chat Suggestionschat-suggestions | simple-ai | Components | Free | no deps | |
| Editable Handleeditable-handle | simple-ai | Components | Free | 1 dep | |
| Generate Text Nodegenerate-text-node | simple-ai | Components | Free | 1 dep |
