A tui date picker control built with and for Next.js
Installations
npm install nextjs-tui-date-picker
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
20.9.0
NPM Version
10.5.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.57%)
JavaScript (2.43%)
Developer
Download Statistics
Total Downloads
11,427
Last Day
27
Last Week
111
Last Month
670
Last Year
8,372
GitHub Statistics
6 Stars
102 Commits
2 Forks
1 Watching
1 Branches
2 Contributors
Package Meta Information
Latest Version
2.2.3
Package Id
nextjs-tui-date-picker@2.2.3
Unpacked Size
127.61 kB
Size
21.38 kB
File Count
20
NPM Version
10.5.0
Node Version
20.9.0
Publised On
22 Mar 2024
Total Downloads
Cumulative downloads
Total Downloads
11,427
Last day
107.7%
27
Compared to previous day
Last week
4.7%
111
Compared to previous week
Last month
-14.1%
670
Compared to previous month
Last year
174%
8,372
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
10
Dev Dependencies
4
nextjs-tui-date-picker
nextjs-tui-date-picker
allows you to pick a date using a pop-up calendar in Next.js
.
Document
Installation
This library use nextjs-tui-date-picker
, so you need to install it.
1npm install --save nextjs-tui-date-picker
or
1yarn add nextjs-tui-date-picker
How to use
- TuiDatePicker
1'use client'; 2 3import { TuiDatePicker } from 'nextjs-tui-date-picker'; 4 5<TuiDatePicker 6 handleChange={handleChange} 7 date={new Date('2023-01-01')} 8 inputWidth={140} 9 fontSize={16} 10/>
- If you wanna change format or language
1const options: DateRangePickerOption = { 2 language: 'en', 3 format: 'MM-dd YYYY', 4}; 5 6return ( 7 <> 8 <TuiDateRangePicker 9 handleChange={handleChange} 10 options={options} 11 /> 12 </> 13);
Demos
- nextjs-tui-date-picker.
Properties
Below are nextjs-tui-date-picker
specific properties.
Prop | required | Type | Description |
---|---|---|---|
handleChange | true | (e) => void | Functions to run when value changes |
options | false (but recommended) | DateRangePickerOption | More detail |
date | false | Date | Initial date ( not using nextjs-tui-range-picker) |
startpickerDate | false | Date | Initial Start date in range-picker (only using in nextjs-tui-range-picker) |
endpickerDate | false | Date | Initial date End Date in range-picker (only using in nextjs-tui-range-picker) |
inputWidth | false | number | Input width |
containerWidth | false | number | Overall component width |
Below are options
properties of nextjs-tui-date-picker
.
options
Prop | required | Type | Description |
---|---|---|---|
date | x | Date | Initial date. Set by a Date instance or a number(timestamp). (default: no initial date). |
language | x | string = 'en' | DatePicker type. Determine whether to choose a date, month, or year. |
timePicker | x | [ object boolean ] | TimePicker options. Refer to the TimePicker instance's options. To create the TimePicker without customization, set to true. |
calendar | x | [ object ] | Calendar options. Refer to the Calendar instance's options. |
input | x | [ object ] | element : HTMLElement, formant : string = 'yyyy-mm--dd' |
selectableRanges | x | Array.<Array.> | Ranges of selectable date. Set by Date instances or numbers(timestamp). |
openers | x | Array = [] | List of the openers to open the DatePicker (example - icon, button, etc.) |
showAlways | x | boolean = true | Show the DatePicker always |
autoClose | x | boolean = true | Close the DatePicker after clicking the date. |
usageStatistics | x | boolean = true | Send a hostname to Google Analytics (default: true) |
weekStartDay | x | string = 'Sun' | Start of the week. 'Sun', 'Mon', ..., 'Sat'(default: 'Sun'(start on Sunday)) |
Example code
You can see the example code and demo.
Clone the repository
1git clone https://github.com/in-ch/nextjs-tui-date-picker.git
Install libraries
1cd example/example_nextjs_app_dir
or
1cd example/example_nextjs_page_dir
and
1npm install
Contribute
You can follow below to contribute nextjs-tui-date-picker
Clone the repository.
1git clone https://github.com/in-ch/nextjs-tui-date-picker.git
No vulnerabilities found.
No security vulnerabilities found.