npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@inverz/thai-timepicker

v1.0.0

Published

React time picker with Thai labels, 24h/12h, minute steps and min/max time — no dependencies

Readme

@inverz/thai-timepicker

React time picker ภาษาไทย เลือกเวลาจากคอลัมน์ชั่วโมง/นาที รองรับ 24 และ 12 ชั่วโมง พิมพ์ตัวเลขเพื่อกระโดดไปที่เวลานั้นได้ เลือกนาทีทีละช่วง จำกัดเวลาทำการ และใช้ได้ด้วยคีย์บอร์ด ไม่มี dependency นอกจาก React

ดูตัวอย่าง (Demo)

A dependency-free React time picker with Thai labels. The value is a plain 24-hour "HH:mm" string, whatever the display format.

ติดตั้ง

npm i @inverz/thai-timepicker

ใช้งาน

import "@inverz/thai-timepicker/style.css";
import ThaiTimePicker from "@inverz/thai-timepicker";

function Example() {
  const [time, setTime] = useState("09:30");
  return <ThaiTimePicker value={time} onChange={setTime} />;
}

onChange ได้ค่าเป็นสตริง 24 ชม. เช่น "14:30" (หรือ "14:30:15" เมื่อใช้ showSeconds) และได้ null เมื่อกดล้างค่า

ตัวอย่าง

// นัดหมายทีละ 15 นาที
<ThaiTimePicker minuteStep={15} value={time} onChange={setTime} />

// เวลาทำการ 09:00–17:30
<ThaiTimePicker minTime="09:00" maxTime="17:30" minuteStep={30} value={time} onChange={setTime} />

// ภาษาอังกฤษ ระบบ 12 ชั่วโมง (ค่าที่ได้ยังเป็น 24 ชม.)
<ThaiTimePicker locale="en" hour12 value={time} onChange={setTime} />

// เวลาเริ่ม – เวลาสิ้นสุด
<ThaiTimePicker value={start} onChange={setStart} />
<ThaiTimePicker value={end} onChange={setEnd} minTime={start ?? undefined} />

// ใช้ใน <form> แบบ uncontrolled
<label htmlFor="checkin">เวลาเช็กอิน</label>
<ThaiTimePicker id="checkin" name="checkin" defaultValue="14:00" />

ใช้ id + <label htmlFor> หรือ aria-labelledby ในการติดป้าย อย่าเอา <label> ครอบตัวคอมโพเนนต์ เพราะคลิกในแผงเลือกเวลาจะถูกส่งต่อไปที่ปุ่มและปิดแผง

Props

| Prop | Type | Default | คำอธิบาย | |---|---|---|---| | value | string \| null | — | ค่าแบบ controlled เช่น "14:30" | | defaultValue | string \| null | null | ค่าเริ่มต้นแบบ uncontrolled | | onChange | (value: string \| null) => void | — | ได้ค่า "HH:mm" / "HH:mm:ss" แบบ 24 ชม. | | locale | "th" \| "en" | "th" | ภาษาของป้ายและปุ่ม | | hour12 | boolean | false | แสดงแบบ 12 ชม. พร้อมคอลัมน์ AM/PM | | showSeconds | boolean | false | เพิ่มคอลัมน์วินาที | | minuteStep | number | 1 | ช่วงของนาที เช่น 5, 15, 30 | | secondStep | number | 1 | ช่วงของวินาที | | minTime / maxTime | string | — | เวลาที่เลือกได้ เช่น "09:00" / "17:30" | | placeholder | string | "เลือกเวลา" | ข้อความตอนยังไม่เลือก | | disabled | boolean | false | | | clearable | boolean | true | แสดงปุ่ม × ล้างค่า | | showNow | boolean | true | แสดงปุ่ม "ตอนนี้" | | inline | boolean | false | แสดงแผงในหน้าโดยตรง ไม่มีช่อง input | | suffix | string | "น." (th) | ข้อความต่อท้ายเวลาในโหมด 24 ชม. | | icon | ReactNode | นาฬิกา | ไอคอนในช่อง input | | name | string | — | เพิ่ม hidden input สำหรับส่งฟอร์ม | | id, className, style, aria-label, aria-labelledby | | | |

คีย์บอร์ด

| ปุ่ม | ทำอะไร | |---|---| | 0–9 | พิมพ์เวลาได้เลย เช่น 1430 = 14:30 ตัวเลือกจะเลื่อนไปที่ค่านั้นและข้ามคอลัมน์เมื่อครบ 2 หลัก (นาทีที่ไม่ตรง minuteStep จะปัดไปช่องที่ใกล้ที่สุด) พิมพ์ที่ช่อง input ก็เปิดแผงให้เอง | | A / P | เลือก AM / PM เมื่อใช้ hour12 | | ↓ / Enter ที่ช่อง input | เปิดแผง | | ↑ ↓ | เปลี่ยนค่าในคอลัมน์ | | ← → | ย้ายคอลัมน์ | | PgUp PgDn / Home End | ขยับทีละ 5 / ไปค่าแรก–ค่าสุดท้าย | | Enter / Esc | ปิดแผง |

ปรับธีม

override ตัวแปร CSS --ttp-* ได้ที่ :root หรือ element ครอบ:

:root {
  --ttp-font: "IBM Plex Sans Thai", sans-serif;
  --ttp-brand: #7c3aed;
  --ttp-brand-soft: #f5f3ff;
  --ttp-brand-ring: #ede9fe;
  --ttp-brand-strong: #6d28d9;

  /* หัวแผงสีทึบ */
  --ttp-header-bg: #7c3aed;
  --ttp-header-text: #fff;
  --ttp-header-muted: rgba(255, 255, 255, 0.7);
  --ttp-header-hover: rgba(255, 255, 255, 0.18);
  --ttp-header-hover-text: #fff;
}

ถ้าใช้คู่กับ @inverz/thai-datepicker ตัวแปรที่ยังไม่ได้ตั้งจะใช้ค่าจาก --tdp-* แทน ธีมของทั้งสองตัวจึงเป็นชุดเดียวกันโดยไม่ต้องตั้งซ้ำ

ตัวแปรทั้งหมดดูได้ที่ src/style.css

พัฒนา

npm install
npm run dev       # เปิดหน้าตัวอย่าง (demo/) ที่ใช้โค้ดจาก src/ โดยตรง
npm run build     # สร้าง dist/ (ESM + CJS + style.css + types)
npm pack          # สร้าง .tgz ไว้ลองติดตั้งในโปรเจกต์อื่นก่อน publish

License

MIT © 2026 Inverz Solutions Co.,Ltd.