Date panel component for React
Go to file
Astrian Zheng 1eb59aa151
All checks were successful
Publish to npm / publish (push) Successful in 29s
feat: add value prop to SingleWeekPicker for programmatic date control
2025-02-20 20:35:13 +11:00
.gitea/workflows feat: update npm publishing workflow to set access level based on branch 2025-02-20 11:25:28 +11:00
marketing_assets feat: add preview image and description to README for Datenel components 2025-02-20 19:59:17 +11:00
playground feat: add value prop to SingleWeekPicker for programmatic date control 2025-02-20 20:35:13 +11:00
src feat: add value prop to SingleWeekPicker for programmatic date control 2025-02-20 20:35:13 +11:00
.gitignore chore: update .gitignore to exclude compiled CSS files 2025-02-19 20:50:46 +11:00
.npmignore chore: add .npmignore and update package.json for build and peer dependencies 2025-02-20 11:13:30 +11:00
eslint.config.js initial commit 2025-02-19 19:36:11 +11:00
LICENSE chore: add MIT License file to the repository 2025-02-20 10:35:29 +11:00
package-lock.json feat: add vite-plugin-css-injected-by-js for improved CSS handling and update app import path 2025-02-20 14:52:48 +11:00
package.json fix: update package.json to use UMD format for main and require exports 2025-02-20 20:10:48 +11:00
README.md feat: add preview image and description to README for Datenel components 2025-02-20 19:59:17 +11:00
tsconfig.app.json feat: update TypeScript configuration and enhance SingleDatePicker component with improved typing 2025-02-20 13:46:44 +11:00
tsconfig.json feat: update TypeScript configuration and enhance SingleDatePicker component with improved typing 2025-02-20 13:46:44 +11:00
tsconfig.node.json feat: update TypeScript configuration and enhance SingleDatePicker component with improved typing 2025-02-20 13:46:44 +11:00
vite.config.ts refactor: enable source maps in Vite config 2025-02-20 20:20:25 +11:00

Datenel

Datenel = Date + Panel

Datenel is a web UI component for selecting dates. It provides a customizable date picker panel that can be easily integrated into your React applications.

A preview of Datenel components for SingleWeekPicker and SingleDayPicker

Shadow border not included. Battery included.

A Vue.js-supported version is in development.

Features

  • Zero runtime dependencies: Slim size with low to 14.26 kB, also flexible to your favorite time processing library.
  • Customizable Colors: Easily change the main, accent, reversed, hover, and border colors of the panel.
  • Localization: Supports localization for different languages.
  • Accessibility: Includes features for screen readers and keyboard navigation.
  • Programmatic Control: Control the selected date programmatically and handle date selection events.
  • JSDoc Support: Full IDE prompt support to help you use Datenel more conveniently.

Installation

To install Datenel, use npm or yarn:

npm install datenel-react # Use npm
yarn add datenel-react # Use yarn

Usage

Here is an example of how to use Datenel in your React application:

import React from 'react'
import { SingleDatePicker } from 'datenel-react'

export default () => {
  function onSelect(value) {
    alert(`You selected ${value.year}-${value-month}-${value.day}`)
  }

  return (
    <div className='app'>
      <div className="border">
        <SingleDatePicker 
          value={{
            year: 2025,
            month: 1,
            day: 1
          }}
          onSelect={onSelect}
        />
      </div>
    </div>
  )
}

Supported Components & Props

  • SingleDatePicker
  • SingleWeekPicker
  • MultipleDatePicker
  • DateRangePicker

More features are on the roadmap.

Contribution & Development

npm i # or `yarn`
npm run dev # or `yarn dev`

Then the package will launch a testing React hot-reload server on localhost:1926. The server file is available in the playground folder, feel free to modify the content inside it.

License

MIT