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

@octane-xplat/date-picker

v0.14.0

Published

Platform-specific date and time selection controls for Octane xplat

Readme

@octane-xplat/date-picker

Platform-specific date and time pickers for Octane xplat apps: a SwiftUI DatePicker on iOS, Material 3 DatePicker/TimePicker built with Jetpack Compose on Android, and a real NSDatePicker on macOS. For portable form controls that work on every target, use Calendar, DateInput, TimeInput, DateTimeInput, and DateRangeInput from @octane-xplat/ui.

import { useState } from 'octane'
import { DateInput } from '@octane-xplat/ui'

export function DepartureDate() {
	const [date, setDate] = useState<string | null>('2026-10-02')
	return <DateInput value={date} onChange={setDate} label="Departure" />
}

There is no shared picker component. Install the package in the app that renders a control, then import SwiftUIDatePicker from @octane-xplat/date-picker/ios, MaterialDatePicker from @octane-xplat/date-picker/android, or AppKitDatePicker from @octane-xplat/date-picker/macos in the matching platform-suffixed file. These native entries have platform-specific contracts. The old @octane-xplat/date-picker/web DateInput subpath was removed because its browser-only string contract conflicted with the shared DateInput API.

/** @jsxImportSource @nativescript-community/octane */
// SwiftUIDatePickerExample.ios.tsx
import { SwiftUIDatePicker } from '@octane-xplat/date-picker/ios'

export function Picker() {
	return (
		<SwiftUIDatePicker
			defaultSelection={new Date(2026, 9, 2)}
			displayedComponents={['date']}
			pickerStyle="graphical"
			onSelectionChange={console.log}
		/>
	)
}
/** @jsxImportSource @nativescript-community/octane */
// MaterialDatePickerExample.android.tsx
import { MaterialDatePicker } from '@octane-xplat/date-picker/android'

const initialDate = new Date(2026, 9, 2)
const bounds = { start: new Date(2026, 0, 1), end: new Date(2026, 11, 31) }

export function Picker() {
	return (
		<MaterialDatePicker
			initialDate={initialDate}
			selectableDates={bounds}
			onDateSelected={console.log}
		/>
	)
}
// AppKitDatePickerExample.macos.tsx
import { AppKitDatePicker } from '@octane-xplat/date-picker/macos'

export function Picker() {
	return (
		<AppKitDatePicker
			components="date"
			pickerStyle="graphical"
			defaultSelection={new Date(2026, 9, 2)}
			onSelectionChange={console.log}
		/>
	)
}

The platform APIs use their own selection vocabulary: the iOS entry takes a controlled selection/defaultSelection Date with displayedComponents and pickerStyle; the Android entry follows the uncontrolled initialDate/onDateSelected model of the Material 3 pickers with selectableDates range bounds; the macOS entry takes components/pickerStyle ('graphical' embeds the inline calendar) with a controlled selection Date.

// Departure.macos.tsx
import { useState } from 'octane'
import { AppKitDatePicker } from '@octane-xplat/date-picker/macos'

export function Departure() {
	const [selection, setSelection] = useState(new Date(2026, 9, 2))
	return (
		<AppKitDatePicker
			components="date"
			pickerStyle="graphical"
			selection={selection}
			onSelectionChange={setSelection}
		/>
	)
}

Android notes: give MaterialDatePicker a bounded height (the M3 calendar's lazy grid collapses under unbounded height), and keep initialDate and selectableDates identity-stable — the provider keys its state remember on them, so a per-render new Date() resets the selection. See the framework guide for details and maintained examples: docs/platform/date-picker.md.

/** @jsxImportSource @nativescript-community/octane */
// Departure.android.tsx — reuse these objects while the picker is mounted.
import { MaterialDatePicker } from '@octane-xplat/date-picker/android'

const initialDate = new Date(2026, 9, 2)
const selectableDates = { start: new Date(2026, 0, 1) }
export function Departure() {
	return (
		<MaterialDatePicker
			className="departure-calendar"
			initialDate={initialDate}
			selectableDates={selectableDates}
			onDateSelected={console.log}
		/>
	)
}
/* App stylesheet: give the Android calendar room for its grid. */
.departure-calendar {
	height: 480px;
}

The native implementations are adapted from @expo/ui (MIT, packages/expo-ui sdk-57): ios/DatePickerView.swift and android/.../ui/DatePickerView.kt. Attribution headers sit on the ported files.