united-tattoo/components/united/sticky-split.tsx
Nicholai 3e739877b4 feat(components): add new UI components for enhanced user experience
- Introduced multiple new components including AnimatedLink, Button, Calendar, Card, ColorSwatch, Divider, Filmstrip, FormContainer, FormField, GalleryCard, Heading, HeroOverlay, IdentitySection, ImmersionSection, NewArtistsSection, NewContactSection, NewHero, NewNavigation, Reveal, SectionLabel, StickySplit, and Toast.
- Each component is designed with responsive layouts and customizable styles to improve the overall UI consistency and interactivity.
- Implemented accessibility features and animations to enhance user engagement.

This commit significantly expands the component library, providing a robust foundation for building a cohesive user interface.
2025-11-25 03:00:50 -07:00

30 lines
824 B
TypeScript

import * as React from "react"
import { cn } from "@/lib/utils"
export interface StickySplitProps extends React.HTMLAttributes<HTMLDivElement> {
sidebar: React.ReactNode
sidebarClassName?: string
}
const StickySplit = React.forwardRef<HTMLDivElement, StickySplitProps>(
({ className, sidebar, sidebarClassName, children, ...props }, ref) => {
return (
<div
ref={ref}
className={cn(
"grid gap-[clamp(1.5rem,4vw,4rem)]",
"grid-cols-1 md:grid-cols-[minmax(260px,0.85fr)_minmax(320px,1fr)]",
className,
)}
{...props}
>
<aside className={cn("md:sticky md:top-20 md:self-start", sidebarClassName)}>{sidebar}</aside>
<div>{children}</div>
</div>
)
},
)
StickySplit.displayName = "StickySplit"
export { StickySplit }