Skip to Content

sticky-bar

ui

Position-sticky container for headers or action bars.

Source Code

View the full component source code below.

import * as React from "react"

import { cn } from "@/lib/utils"

function StickyBar({
  children,
  position = "top",
  className,
  ...props
}: {
  children: React.ReactNode
  position?: "top" | "bottom"
} & React.ComponentProps<"div">) {
  return (
    <div
      data-slot="sticky-bar"
      data-position={position}
      className={cn(
        "sticky z-40 border-border bg-background/80 backdrop-blur-lg",
        position === "top" ? "top-0 border-b" : "bottom-0 border-t",
        className
      )}
      {...props}
    >
      {children}
    </div>
  )
}

export { StickyBar }

Installation

npx shadcn@latest add https://registry.mukoko.com/api/v1/ui/sticky-bar

API

Fetch this component's metadata and source code from the registry API.

GET/api/v1/ui/sticky-bar

Source

components/ui/sticky-bar.tsx