my/ui

Command Palette

Search for a command to run...

All components

Right Navigation Calendar

calendar

Origin UI component.

responsive · 600px

Install

Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:

$npx shadcn@latest add https://your-domain/r/comp-496.json

Usage

import Cmp from "@/registry/origin-ui/comp-496";

export default function Demo() {
  return <Cmp />;
}

Component source

"use client";

import { useState } from "react";

import { Calendar } from "@/components/ui/calendar";

export default function Component() {
  const [date, setDate] = useState<Date | undefined>(new Date());

  return (
    <div>
      <Calendar
        className="rounded-md border p-2"
        classNames={{
          month_caption: "ms-2.5 me-20 justify-start",
          nav: "justify-end",
        }}
        mode="single"
        onSelect={setDate}
        selected={date}
      />
      <p
        aria-live="polite"
        className="mt-4 text-center text-muted-foreground text-xs"
        role="region"
      >
        Right navigation -{" "}
        <a
          className="underline hover:text-foreground"
          href="https://daypicker.dev/"
          rel="noreferrer noopener nofollow"
          target="_blank"
        >
          React DayPicker
        </a>
      </p>
    </div>
  );
}

Source: Origin UI