Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tw-daterange

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tw-daterange

A date range picker component for React built using tailwind and date-fns

  • 1.1.25
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
23
decreased by-8%
Maintainers
1
Weekly downloads
 
Created
Source

tw-daterange

A DateRange picker made with tailwind and date-fns

tw-daterange


How to install

  1. Make sure you have tailwind installed and setup

  2. using npm

npm install tw-daterange

using yarn

yarn add tw-daterange
  1. Add the configuration to your tailwind.config.js
module.exports = {
  // ...
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
    "./node_modules/tw-daterange/dist/index.esm.js",
  ],
  // ...
}

How to use

import { useState } from "react"
import DateRangePicker from "tw-daterange"

const App = () => {
  const [range, setRange] = useState({
    startDate: new Date(),
    endDate: new Date(),
  })

  return (
    <DateRangePicker
      initialRange={range}
      onUpdate={(dateRange) => {
        setRange(dateRange)
      }}
    />
  )
}

export default App

License

MIT © Swapnil Soni

FAQs

Package last updated on 14 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc