Coder Social home page Coder Social logo

cmoen11 / react-semantic-ui-datepickers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arthurdenner/react-semantic-ui-datepickers

0.0 1.0 0.0 2.06 MB

Datepickers built with Semantic UI for React and Dayzed.

Home Page: https://react-semantic-ui-datepickers.now.sh

License: MIT License

JavaScript 4.34% CSS 2.89% Dockerfile 0.46% TypeScript 92.31%

react-semantic-ui-datepickers's Introduction

πŸ“† react-semantic-ui-datepickers

Datepickers built with Semantic UI for React and Dayzed

version MIT License All Contributors

Overview

Semantic UI for React doesn't have a datepicker and the best solutions don't fit with its design. This library tries to solve this problem providing a component that can act as a basic or range datepicker.

It supports most props of Form.Input and Dayzed components. Check the supported props section for more information.

Table of Contents

Installation

npm install --save react-semantic-ui-datepickers
yarn add react-semantic-ui-datepickers

This package also depends on react and semantic-ui-react. Please make sure you have them installed as well.

Usage

import React from 'react';
import SemanticDatepicker from 'react-semantic-ui-datepickers';
import 'react-semantic-ui-datepickers/dist/react-semantic-ui-datepickers.css';

const AppWithBasic = ({ onChange }) => (
  <SemanticDatepicker onChange={onChange} />
);

const AppWithRangeAndInPortuguese = ({ onChange }) => (
  <SemanticDatepicker locale="pt-BR" onChange={onChange} type="range" />
);

More examples here.

Supported Props

Own Props

property type required default description
allowOnlyNumbers boolean no true Allows the user enter only numbers
clearOnSameDateClick boolean no true Controls whether the datepicker's state resets if the same date is selected in succession.
clearable boolean no true Allows the user to clear the value
filterDate function no () => true Function that receives each date and returns a boolean to indicate whether it is enabled or not
format string no 'YYYY-MM-DD' Specifies how the date will be formatted using the date-fns' format
keepOpenOnClear boolean no false Keeps the datepicker open (or opens it if it's closed) when the clear icon is clicked
keepOpenOnSelect boolean no false Keeps the datepicker open when a date is selected
locale string no 'en-US' Filename of the locale to be used. PS: Feel free to submit PR's with more locales!
onBlur function no () => {} Callback fired when the input loses focus
onChange function no () => {} Callback fired when the value changes
pointing string no 'left' Location to render the component around input. Available options: 'left', 'right', 'top left', 'top right'
type string no basic Type of input to render. Available options: 'basic' and 'range'
datePickerOnly boolean no false Allows the date to be selected only via the date picker and disables the text input

Form.Input Props

  • disabled
  • error
  • icon
  • iconPosition
  • id
  • label
  • loading
  • name
  • placeholder
  • size
  • transparent
  • readOnly

Dayzed Props

  • date
  • maxDate
  • minDate
  • firstDayOfWeek
  • showOutsideDays
  • selected

Customization

In order to customize the elements, you can override the styles of the classes below:

  • clndr-cell
  • clndr-cell-today
  • clndr-cell-inrange
  • clndr-cell-disabled
  • clndr-cell-selected
  • clndr-cell-other-month

If you think this way of customizing is not a good idea, feel free to open an issue suggesting something else. This was the simplest solution I thought.

Roadmap

  • Improve accessibility

    @donysukardi did some work on accessibility in the BaseDatePicker, but I couldn't get it working correcly. Feel free to help on this!

  • Add more tests (including e2e)

    The current threshold is pretty useless πŸ˜•

Feel free to open issues and/or create PRs to improve other aspects of the library!

Contributors

Thanks goes to these wonderful people (emoji key):


Arthur Denner

πŸ’» 🎨 πŸ“– πŸ’‘ πŸ€”

Emerson Laurentino

πŸ’» πŸ€” πŸ“– πŸ’‘

Lucas Borges

πŸ’» πŸ“– πŸ’‘

Rallysson

πŸ“–

Samin Yousefnia

🌍

James J. Alavosus

πŸ’» πŸ’‘ πŸ€”

Jakub Wietrzyk

πŸ’» 🌍

Ben Hancock

πŸ’»

Gallevy

🌍

Adam Grawender

🌍

xzessmedia

🌍

oriolhub

🌍

Colin Ramsay

πŸ’»

Gencer W. Genç

🌍

pivotal-james-zcheng

πŸ’»

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

LICENSE

MIT

react-semantic-ui-datepickers's People

Contributors

allcontributors[bot] avatar arthurdenner avatar colinramsay avatar emersonlaurentino avatar gallevy avatar gencer avatar jaaaco avatar jalavosus avatar lucasvnborges avatar oriolhub avatar pivotal-james-zcheng avatar rallysson avatar renovate[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.