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 🙏

© 2024 – Pkg Stats / Ryan Hefner

kara-persian-datepicker

v1.0.8

Published

A modern, Persian date picker for React applications. This date picker supports both light and dark themes, providing a sleek and user-friendly interface for selecting dates.

Downloads

126

Readme

Kara Persian DatePicker

A modern, Persian date picker for React applications. This date picker supports both light and dark themes, providing a sleek and user-friendly interface for selecting dates.

Demo

View more Demo

Installation

npm

To install the package via npm, run:

npm install kara-persian-datepicker

yarn

yarn add kara-persian-datepicker

Usage

import React, {useState} from 'react';
import {DatePicker} from 'kara-persian-datepicker';
import 'kara-persian-datepicker/dist/index.css';

const App: React.FC = () => {
    const [selectedDate, setSelectedDate] = useState < string | null > (null);

    return (
        <div>
            <h1>Kara Persian DatePicker</h1>
            <DatePicker
                value={selectedDate}
                onChange={(date) => {
                    console.log(date);
                    setSelectedDate(date);
                }}
                classStyle={{
                    backgroundColor: '#000', // dark background
                    textColor: '#fff', // white text
                    textPlaceholder: 'Pick a date', // Placeholder text in Persian
                    textAlign: 'right', // Text alignment
                    size: 'md', // Size of the date picker
                    radius: '8px', // Border radius for rounded corners
                    borderColor: '#E2e8f0', // Border color for the date picker
                    selectedDayColor: '#007BFF', // Blue color for the selected day
                    inputStyle: {padding: '10px', fontSize: '16px'}, // Custom input styles
                }}
                disabled={false} // Change to true to disable the date picker
                theme="dark" // Change to 'light' for light theme
            />
            {selectedDate && <p>Selected Date: {selectedDate}</p>}
        </div>
    );
};

export default App;

Features

  • Light and Dark Themes: Easily switch between light and dark modes.
  • Modern Design: Flat design with rounded corners for a sleek look.
  • User-Friendly: Simple interface for selecting dates.
  • Responsive: Works well on various screen sizes.

Props

| Prop | Type | Description | |--------------|------------------------|----------------------------------------------------------------------------------------------| | value | string | string Or null | | disabled | boolean | Optional. If true, disables the date picker. | | theme | string | Optional. Allows you to set the theme ('light' or 'dark'). Default is 'light'. | | classStyle | object | Optional | | onChange | (date: Date) => void | Callback function called when a date is selected. Receives the selected date as an argument. |

classStyle Props

| Prop | Value | Description | |-----------------------|-----------------|------------------------------------| | backgroundColor | #000 | Dark background color. | | textColor | #fff | White text color. | | textPlaceholder | 'Pick a date' | Placeholder text (in Persian). | | textAlign | right | Aligns text to the right. | | size | md | Medium size of the date picker. | | radius | 8px | Border radius for rounded corners. | | borderColor | #E2e8f0 | Border color for the date picker. | | selectedDayColor | #007BFF | Blue color for the selected day. | | inputStyle.padding | 10px | Padding for the input field. | | inputStyle.fontSize | 16px | Font size for the input text. |

Customization

You can customize the appearance of the date picker by modifying the CSS file or overriding styles in your own stylesheets. The classStyle prop allows for extensive customization, including background color, text color, and size.

Authors