Seasonal opening hours in React
Two tabs to show different opening hours by season, in a compact card.
Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.
This component also comes in
The code in React
import { useId, useRef, useState, type KeyboardEvent, type ReactNode } from "react";
const tabs: { label: ReactNode; content: ReactNode }[] = [
{
label: <>Haute saison</>,
content: (
<>
<p className="mb-4 text-[#6b4a33] dark:text-[#d8bea6]">Du 1er juin au 15 septembre</p>
<dl className="grid gap-2">
<div className="flex justify-between gap-4 border-b border-[#ead9c6] pb-2 dark:border-[#3d2a1c]">
<dt>Lundi au vendredi</dt>
<dd className="font-bold tabular-nums">7 h – 19 h 30</dd>Free component: copy it freely, including for commercial projects.
Other tabs components in React
Tabs components in React
Accessible tabs on large screens that turn into an accordion on phones, with the right ARIA roles in each mode.
- Tailwind
- React
- CSS
- WordPress

Indicative prices sorted by trade in tabs, with the unit of each service, a VAT-inclusive / excl. switch and a free-quote notice.
- Tailwind
- React
- CSS
- WordPress

Underlined tabs
FreeUnderstated tabs with an underlined active tab, to organize the information on a product page.
- Tailwind
- React
- CSS
- WordPress

A dark code block with one tab per package manager, for technical documentation.
- Tailwind
- React
- CSS
- WordPress