Gathering detailed insights and metrics for @choi12/test-library
Gathering detailed insights and metrics for @choi12/test-library
Gathering detailed insights and metrics for @choi12/test-library
Gathering detailed insights and metrics for @choi12/test-library
npm install @choi12/test-library
Typescript
Module System
Min. Node Version
TypeScript (97.69%)
JavaScript (2.31%)
Love this project? Help keep it running β sponsor us today! π
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
8 Commits
1 Watching
2 Branches
1 Contributors
Latest Version
0.0.1
Package Id
@choi12/test-library@0.0.1
Unpacked Size
49.13 kB
Size
11.02 kB
File Count
77
Publised On
19 Jan 2025
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
3
A lightweight and customizable calendar component for React Native applications. Includes basic features like date marking and modal support, with support for both English and Korean languages.
Left: Default calendar with sky blue theme
Right: Calendar with dark theme customization
Feed Diary (μμΉμΌκΈ°) - A journaling app using CalendarModal component for date selection
1# Using npm 2npm install @choi12/rn-basic-calendar 3 4# Using yarn 5yarn add @choi12/rn-basic-calendar
1# Using npm 2npm install dayjs@^1.11.0 3 4# Using yarn 5yarn add dayjs@^1.11.0
This package requires the following peer dependencies:
1{ 2 "dayjs": "^1.11.0", 3 "react": "^17.0.0 || ^18.0.0", 4 "react-native": ">=0.65.0 <1.0.0" 5}
Note: React and React Native are likely already installed in your project. You only need to install dayjs if you haven't installed it yet.
The package uses the following types for date handling:
1type CalendarDay = Dayjs; // dayjs object for date manipulation 2type MarkedDate = string; // Date string in 'YYYY-MM-DD' format
1import React, { useState } from 'react'; 2import { Calendar } from '@choi12/rn-basic-calendar'; 3import dayjs, { Dayjs } from 'dayjs'; 4 5const MyCalendar = () => { 6 const [value, setValue] = useState<Dayjs>(dayjs()); 7 8 return ( 9 <Calendar 10 value={value} 11 onChange={setValue} 12 markedDates={['2024-01-15', '2024-01-16']} 13 /> 14 ); 15};
1import React, { useState } from 'react'; 2import { View } from 'react-native'; 3import { CalendarModal } from '@choi12/rn-basic-calendar'; 4import dayjs, { Dayjs } from 'dayjs'; 5 6const MyCalendarModal = () => { 7 const [isVisible, setIsVisible] = useState<boolean>(false); 8 const [value, setValue] = useState<Dayjs>(dayjs()); 9 10 return ( 11 <CalendarModal 12 isVisible={isVisible} 13 onClose={() => setIsVisible(false)} 14 value={value} 15 onChange={(date) => { 16 setValue(date); 17 setIsVisible(false); 18 }} 19 /> 20 ); 21};
Prop | Type | Required | Default | Description |
---|---|---|---|---|
value | CalendarDay | Yes | - | Currently selected date |
onChange | (date: CalendarDay)=>void | Yes | - | Callback when a date is selected |
minDate | CalendarDay | No | - | Minimum selectable date |
maxDate | CalendarDay | No | - | Maximum selectable date |
defaultValue | CalendarDay | No | dayjs() | Default selected date |
language | 'en' | 'ko' | No | 'en' | Calendar language |
styles | CalendarStyles | No | {} | Custom styles object |
colors | CalendarColors | No | {} | Custom colors object |
markedDates | string[] | No | [] | Array of dates to be marked (YYYY-MM-DD format) |
Extends Calendar Props with additional properties:
Prop | Type | Required | Default | Description |
---|---|---|---|---|
isVisible | boolean | Yes | - | Controls modal visibility |
onClose | () => void | Yes | - | Callback when modal is closed |
title | string | No | - | Modal title |
overlayOpacity | number | No | 0.5 | Opacity of modal overlay |
1const colors = { 2 primaryColor: '#8CD5E1', // Primary theme color 3 backgroundColor: '#FFFFFF', // Background color 4 textColor: '#4A4A4A', // Text color 5};
1const styles = { 2 // Calendar container 3 containerStyle: {}, 4 daysContainerStyle: {}, 5 weekStyle: {}, 6 7 // Day elements 8 dayContainerStyle: {}, 9 dayTextStyle: {}, 10 selectedDayStyle: {}, 11 selectedDayTextStyle: {}, 12 todayLabelStyle: {}, 13 weekendDayTextStyle: {}, 14 disabledDayTextStyle: {}, 15 16 // Month selector 17 monthSelectorContainerStyle: {}, 18 monthSelectorButtonStyle: {}, 19 monthTextStyle: {}, 20 arrowStyle: {}, 21 disabledArrowStyle: {}, 22 23 // Weekday header 24 weekdayHeaderContainerStyle: {}, 25 weekdayTextStyle: {}, 26 weekendHeaderTextStyle: {}, 27 28 // Modal specific (for CalendarModal) 29 modalOverlayStyle: {}, 30 modalContainerStyle: {}, 31 modalTitleStyle: {}, 32};
1const customColors = { 2 primaryColor: '#8CD5E1', 3 backgroundColor: '#333333', 4 textColor: '#FFFFFF', 5}; 6 7const customStyles = { 8 containerStyle: { borderRadius: 12 }, 9 dayTextStyle: { fontSize: 14 }, 10 selectedDayStyle: { backgroundColor: '#8CD5E1' }, 11 selectedDayTextStyle: { color: '#FFFFFF' }, 12 disabledDayTextStyle: { color: '#989797' }, 13}; 14 15<Calendar 16 value={value} 17 onChange={onChange} 18 language="en" 19 defaultValue={dayjs('2024-01-15')} 20 minDate={dayjs().subtract(2, 'month')} 21 maxDate={dayjs().add(2, 'month')} 22 markedDates={['2025-01-06', '2025-01-07']} 23 colors={customColors} 24 styles={customStyles} 25/>
MIT Β© choi12
No vulnerabilities found.
No security vulnerabilities found.