Skip to content

Commit

Permalink
Rewrite readme (#34)
Browse files Browse the repository at this point in the history
* Rewrite readme

* 1.0.0
  • Loading branch information
Zuruuh committed Mar 28, 2024
1 parent aecd8a1 commit f731f5c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,62 @@
A headless React date picker library for easily integrating date selection into your web applications.
This library provides a flexible and highly customizable date picker, giving you complete control over the presentation and interaction with the .

<!-- ![npm](https://img.shields.io/static/v1?label=&message=@zuruuh/react-date-picker&color=CB3837&logo=npm&logoColor=white) -->

<!-- ![Demo](demo.gif) TODO: add slack date picker demo -->
![npm](https://img.shields.io/static/v1?label=&message=@zuruuh/react-date-picker&color=CB3837&logo=npm&logoColor=white)

## Features

- **Headless**: The library is designed to be headless, meaning you have full control over the rendering, styling, and behavior of the date picker.
- **Highly Customizable**: Customize the appearance, style, and behavior to seamlessly integrate with your project's design.
<!-- - **Keyboard Navigation**: Support for keyboard navigation for improved accessibility. | TODO-->
- **Internationalization**: Supports multiple languages and date formats (powered by DayJS).
- **Lightweight**: A small and efficient library with two runtime dependencies:
- React (obviously) version ^18
- DayJS

## Docs

You can find the docs with reference and better examples at https://date-picker.zuruh.dev

## Quick Start

### Installation

As said above, this lib requires both react and dayjs.

```bash
npm i @zuruuh/react-date-picker dayjs react
```

We also need some specific dayjs plugin, which you can enable by copy/pasting this

### Simple example

```tsx
import { DatePicker } from "@zuruuh/react-date-picker";
//...
const [selectDate, setSelectedDate] = useState<Dayjs | null>(null);

return (
<DatePicker.Root selectedDate={date} setSelectedDate={setDate}>
<DatePicker.Calendar>
<DatePicker.Week>
<DatePicker.Day>
{({ date, onClick }) => (
<button onClick={onClick}>{date.date()}</button>
)}
</DatePicker.Day>
</DatePicker.Week>
</DatePicker.Calendar>
</DatePicker.Root>
);
```

The above example will generate a flat calendar with no markup other than the buttons. You can customize the markup and styling by adding your own jsx to the example wherever you need it

# Contribution

Check the ![contribution guidelines](CONTRIBUTING.md) to contribute to this lib.
Check the [contribution guidelines](CONTRIBUTING.md) to contribute to this library.

## Special thanks

- The [Twemoji](https://github.com/twitter/twemoji) for the great SVGs
- The [DayJS](https://github.com/iamkun/dayjs) team for their awesome lib
- [Twemoji](https://github.com/twitter/twemoji) for the great SVGs
- The [DayJS](https://github.com/iamkun/dayjs) team for their awesome library
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json",
"name": "@zuruuh/react-date-picker",
"private": false,
"version": "0.3.0",
"version": "1.0.0",
"type": "module",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down

0 comments on commit f731f5c

Please sign in to comment.