aboveyunhai / chakra-dayzed-datepicker

Chakra UI + Dayzed = datepicker
https://aboveyunhai.github.io/chakra-dayzed-datepicker/
MIT License
222 stars 46 forks source link

Is there a way to increase the width to take all the space possible? #80

Open mDeSimone-DFactorySrl opened 2 months ago

mDeSimone-DFactorySrl commented 2 months ago

Hi all, sorry for the stupid questions, i have a SingleDatePicker in my form and i am not able to increase the width of the "box" to take all the space possible. immagine wor widthseems not working. Can someone help me? My component code is:

<Flex justifyContent="center" minHeight="100vh">
  <Box maxWidth="800px">
    <FormControl id="Data" mb={3}>
        <Text mb={1} textAlign="center">Data</Text>
        <SingleDatepicker name="date-input" date={date} onDateChange={setDate}
        configs={{
            dateFormat: 'yyyy-MM-dd',
            dayNames: 'Dom,Lun,Mar,Mer,Gio,Ven,Sab'.split(','), // length of 7
            monthNames: 'Gen,Feb,Mar,Apr,Mag,Giu,Lug,Ago,Set,Ott,Nov,Dec'.split(','), // length of 12
            firstDayOfWeek: 1, // default is 0, the dayNames[0], which is Sunday if you don't specify your own dayNames,
          }}
         propsConfigs={{
            dateNavBtnProps: {
              colorScheme: "blue",
              variant: "outline"
            },
            dayOfMonthBtnProps: {
              defaultBtnProps: {
                _hover: {
                  background: 'blue.400',
                  color: "black",
                }
              },
              selectedBtnProps: {
                background: "blue.200",
                color: "black",
              },
              todayBtnProps: {
                background: "#4681ac",
              }
            },
          }}/>
    </FormControl>
  </Box>
</Flex>
aboveyunhai commented 2 months ago

https://github.com/aboveyunhai/chakra-dayzed-datepicker/blob/23483296fc6481a26fbded31dee56803157a82ab/src/single.tsx#L178-L179

maybe triggerBtnProps ?

mDeSimone-DFactorySrl commented 2 months ago

https://github.com/aboveyunhai/chakra-dayzed-datepicker/blob/23483296fc6481a26fbded31dee56803157a82ab/src/single.tsx#L178-L179

maybe triggerBtnProps ? Sorry, i do not understand. where should i use triggerBtnProps inside the propsConfigs?

Edit. Found the way to add it, unfortunately it will only increase the text but not the dimension of the box. immagine

zielsko commented 1 month ago

Hi,

const propsConfigs={ triggerBtnProps: { width: '100%' // or other size that you need } }

and then

<SingleDatepicker ... propsConfigs={propsConfigs}/>

mDeSimone-DFactorySrl commented 1 month ago

Hi,

const propsConfigs={ triggerBtnProps: { width: '100%' // or other size that you need } }

and then

<SingleDatepicker ... propsConfigs={propsConfigs}/>

Thanks a lot, working flawless. <3