This repository has been archived on 2024-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
tailwindui/react/components/application-ui/application-shells/multi-column/constrained_with_sticky_columns.jsx

40 lines
1.6 KiB
React
Raw Normal View History

2024-01-24 19:02:44 +08:00
import { BellIcon } from '@heroicons/react/24/outline'
export default function Example() {
return (
<div className="flex min-h-full flex-col">
<header className="shrink-0 border-b border-gray-200 bg-white">
<div className="mx-auto flex h-16 max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8">
<img
className="h-8 w-auto"
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600"
alt="Your Company"
/>
<div className="flex items-center gap-x-8">
<button type="button" className="-m-2.5 p-2.5 text-gray-400 hover:text-gray-300">
<span className="sr-only">View notifications</span>
<BellIcon className="h-6 w-6" aria-hidden="true" />
</button>
<a href="#" className="-m-1.5 p-1.5">
<span className="sr-only">Your profile</span>
<img
className="h-8 w-8 rounded-full bg-gray-800"
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
alt=""
/>
</a>
</div>
</div>
</header>
<div className="mx-auto flex w-full max-w-7xl items-start gap-x-8 px-4 py-10 sm:px-6 lg:px-8">
<aside className="sticky top-8 hidden w-44 shrink-0 lg:block">{/* Left column area */}</aside>
<main className="flex-1">{/* Main area */}</main>
<aside className="sticky top-8 hidden w-96 shrink-0 xl:block">{/* Right column area */}</aside>
</div>
</div>
)
}