ForwardWidgets
Widgets for Douban and Trakt watchlists plus personalized recommendations, live TV streaming including PlutoTV, Yatu ra…
Serve headless component development kit for React production apps
A tiny, headless calendar hook for React.
ENGLISH | 한국어
@h6s/calendar is a headless calendar hook library for React. It provides date calculations, navigation, and selection logic — you bring the markup and styles.
npm install @h6s/calendar
import { useCalendar } from '@h6s/calendar';
function Calendar() {
const { headers, body, navigation } = useCalendar();
return (
<table>
<thead>
<tr>
{headers.weekdays.map(({ key, value }) => (
<th key={key}>{value.toLocaleDateString('en', { weekday: 'short' })}</th>
))}
</tr>
</thead>
<tbody>
{body.value.map((week) => (
<tr key={week.key}>
{week.value.map((day) => (
<td key={day.key}>{day.value.getDate()}</td>
))}
</tr>
))}
</tbody>
</table>
);
}
No CSS to override. No class names to memorize. Just data and your components.
useSelection(options)Composable date selection with three modes:
const { body: selectionBody, select, selected } = useSelection({
mode: 'single', // 'single' | 'range' | 'multiple'
body,
disabled: [
{ dayOfWeek: [0, 6] }, // weekends
{ before: new Date() }, // past dates
],
});
| Mode | Selected Type | Use Case |
|---|---|---|
single |
Date | undefined |
Date picker, birthday selector |
range |
{ from: Date, to?: Date } |
Hotel booking, leave requests |
multiple |
Date[] |
Scheduling, availability picker |
Interactive Sandpack playgrounds — edit directly in the browser:
| Style | DatePicker | DateRangePicker |
|---|---|---|
| Tailwind CSS | Demo | Demo |
| Bootstrap | Demo | Demo |
| Vanilla CSS | Demo | Demo |
We welcome contributions from everyone. Please read the Contributing Guide before submitting a pull request.
git clone https://github.com/toss/h6s.git cd h6s && yarn yarn storybook
Maintenance mode — Stable, bug fixes only.
MIT © Viva Republica, Inc. See LICENSE for details.
more like this
Widgets for Douban and Trakt watchlists plus personalized recommendations, live TV streaming including PlutoTV, Yatu ra…
search projects, people, and tags