Skip to content

Seasonal opening hours in Tailwind CSS

Two tabs to show different opening hours by season, in a compact card.

Here is an excerpt of this component's code in Tailwind CSS. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in Tailwind CSS

index.html
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Horaires par saison</title>
    <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.3.3"></script>
    <style type="text/tailwindcss">
      @custom-variant dark {
        @media (prefers-color-scheme: dark) {
          &:where(:root:not([data-theme="light"]), :root:not([data-theme="light"]) *) {
            @slot;

Free component: copy it freely, including for commercial projects.

Tabs components in Tailwind CSS
  • Accessible tabs on large screens that turn into an accordion on phones, with the right ARIA roles in each mode.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • 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
    Component
  • Understated tabs with an underlined active tab, to organize the information on a product page.

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

    • Tailwind
    • React
    • CSS
    • WordPress
    Component