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/headings/section-headings/with_inline_tabs.jsx

38 lines
1.1 KiB
React
Raw Normal View History

2024-01-24 19:02:44 +08:00
const tabs = [
{ name: 'Open', href: '#', current: true },
{ name: 'Closed', href: '#', current: false },
]
function classNames(...classes) {
return classes.filter(Boolean).join(' ')
}
export default function Example() {
return (
<div className="border-b border-gray-200">
<div className="sm:flex sm:items-baseline">
<h3 className="text-base font-semibold leading-6 text-gray-900">Issues</h3>
<div className="mt-4 sm:ml-10 sm:mt-0">
<nav className="-mb-px flex space-x-8">
{tabs.map((tab) => (
<a
key={tab.name}
href={tab.href}
className={classNames(
tab.current
? 'border-indigo-500 text-indigo-600'
: 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700',
'whitespace-nowrap border-b-2 px-1 pb-4 text-sm font-medium'
)}
aria-current={tab.current ? 'page' : undefined}
>
{tab.name}
</a>
))}
</nav>
</div>
</div>
</div>
)
}