百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

datepicker

> 前端框架
开源

使用 Chakra-UI 和 date-fns 实现的简单日期选择器

193 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 Chakra-UI 和 date-fns 实现的简单日期选择器

Datepicker

A simple datepicker component build with date-fns and Chakra-UI.

Table of Contents

  • Requisites
  • Installation and Usage
  • Customizing
  • License

Requisites

You need to install date-fns and chakra-ui in order to use this library.

bash
yarn add date-fns

To install chakra-ui follow their guide here.

Installation and Usage

After install these dependencies you can now install the library and use this as below:

bash
yarn add @uselessdev/datepicker

Before to use this you can create your own theme or use the default one.

…

note that the example above doens't render an input but only the calendar

If you want to use this with inputs and a popover you can see this example

Customizing

You can fully customize the Calendar component using the extendTheme provided by chakra-ui, you can see an example below.

In your theme you can overrides the default theme (you can see all available components keys for theme customization here)

…

Now you can use this theme in ChakraProvider:

typescript
import { ChakraProvider } from '@chakra-ui/react'
import { theme } from './theme'

function App() {
  return (
    
      {/* children... */}
    
  )
}

Theses changes will produce the following results in Calendar:

Available components theme keys

Key name Description Parts
Calendar A multipart component this is reponsible for the calendar it self. calendar, months
CalendarMonth Responsible to style one month block. month, name, week, weekday, days
CalendarDay Applies styles to individual day. This is the only single part component. --
CalendarControl Applies styles to prev and next months. controls, button

License

This code is under the Apache-2.0 License

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Wallace Batista

Leonardo Elias

kivi

Guilherme Teixeira

Brano Zavracky

O. Qudah

Tom Chen

Alexandre Stahmer

Raphael da Rocha Pinto Barboza

Greg Leuch

This project follows the all-contributors specification. Contributions of any kind welcome!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptchakra-uidate-fnsdatepickerreact

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架