As you glide your cursor over the Sidebar, the text elegantly curves into view

I'm currently utilizing Chakra UI.
When I hover over the Sidebar, it expands to the right side.
However, the text gets distorted in the process.
Is there a way to widen the Sidebar without distorting the letters?
I would greatly appreciate any guidance on this issue.
code

 <Flex
      background="blue.50"
      flexDirection="column"
      height="100vh"
      justifyContent="space-between"
      onMouseEnter={() => setState((prevState) => !prevState)}
      onMouseLeave={() => setState((prevState) => !prevState)}
      position="fixed"
      width={state ? "204px" : "44px"}
      zIndex={10}
      transition={"all .2s ease"}
    >
      <Box transition="all 0.3s">
        <HStack p={3}>
          <Flex alignItems="center">
            <Image
              display={state ? "none" : "inline-block"}
              height="24px"
              src={""}
              transition="all 0.3s ease-in-out"
            />
            <Image
              display={state ? "inline-block" : "none"}
              src={"chakra_logo.png"}
            />
          </Flex>
          <Text display={state ? "inline-block" : "none"} fontSize="xs">
            logo
          </Text>
        </HStack>
        <VStack mt={3} spacing={0}>
          <Box _hover={{ backgroundColor: "gray.200" }} width="full">
            <Link>
              <a>
                <HStack p={3}>
                  <BiSearchAlt />
                  <Text display={state ? "inline-block" : "none"}>
                    search Page
                  </Text>
                </HStack>
              </a>
            </Link>
          </Box>
        </VStack>
      </Box>
      <VStack mb={2} spacing={0}>
        <Box mb={2} px={3} width="full">
          <Divider borderColor="gray.300" />
        </Box>
        <Box _hover={{ backgroundColor: "gray.200" }} p={3} width="full">
          <HStack>
            <Image src={""} width="24px" />
            <Text display={state ? "inline-block" : "none"}>
              My Page Setting
            </Text>
          </HStack>
        </Box>
      </VStack>
    </Flex>

Answer №1

In order to avoid text wrapping, include the whiteSpace="nowrap" and overflow="hidden" attributes in your <Text /> components.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Alter appearance using various classes

I am seeking assistance in changing the font of text using classes. I have multiple texts with different classes and I want to be able to edit all the texts without adding another dropdown menu. I believe that the change needs to occur in a script. Pleas ...

Compiler error occurs when trying to pass props through a higher-order component via injection

Recently, I have been experimenting with injecting props into a component using a higher order component (HOC). While following this insightful article, I came up with the following HOC: // WithWindowSize.tsx import React, {useEffect, useMemo, useState} fr ...

Assistance needed for Internet Explorer

When I designed a webpage in Firefox, everything looked great. However, when I opened it in Internet Explorer and resized the window to less than maximum size, half of the main div disappeared under the footer. If you want to see the issue for yourself, v ...

Sending variables to other parts of the application within stateless functional components

My main component is Productos and I also have a child component called EditarProductos. My goal is to pass the producto.id value from Productos to EditarProductos. Here is my Productos component code: import {Button, TableHead, TableRow, TableCell, Tabl ...

CSS - Resizing Images

I am experiencing an issue with the width of an image on my website. I want it to span 100% of the browser frame, but it is currently limited to only 1000px wide. Please take a look at: The image in question is located at the top of the page. Is there a ...

The Struggle with Bootstrap Accordion

I'm currently in the process of learning bootstrap. I copied the code for the 'Flush' Accordion from the bootstrap docs, but my version looks completely off. Despite linking the CSS stylesheet and JS Bundle, it doesn't seem to align pro ...

Issue detected in this React flow: the maximum update depth has been exceeded

I am working with the following function: compareProducts = (company) => { console.log(company.productList) let headerSet = false; for (let i in company.productList) { //case1 : looking for data in an array, if found, setState and exi ...

tapping on the division and sliding it to and fro

I am trying to achieve a functionality where clicking a div will move another div to the right by 0, and on clicking the div again, the second div will move to the right by -200. However, I am facing issues getting it to work properly. $(document).ready(f ...

React to the scrolled items as the active object from the mapped array is displayed in the center

, the mapped data appears in a unique way on a timetable, arranged by date (30 days) in a horizontal scroll. With the current date data highlighted as active, the challenge arises when the active date is far down the list, say at the 22nd position, and onl ...

Is there a way for me to modify the color of the currently selected button?

I've been attempting to change the color of the active button when clicked, but my CSS class "activePage" isn't doing the trick. Ideally, clicking the "projects" button should turn it red, and clicking the "about" button should change it to red w ...

Render images conditionally as background elements for the body, ensuring they do not increase the height of pages with minimal content

Incorporating NextJS image components into the RootLayout of a NextJS component with negative z-indexes and absolute positioning was necessary to align them with dynamic content. However, an issue arose when these images at the base route '/' cre ...

Picture not adapting correctly to various screen sizes

I'm looking to adjust the size of an image based on the user's browser window. Here is the code I have so far: .image { max-height: 15%; width: auto; } The image class is used in this section of my code: <ul> <li> <img c ...

Guide on simulating a tab click using jest and enzyme

Trying to execute a simple test scenario: 1- Click on the tab 2- Check if the state is correctly updated 3- Ensure that the content inside the tab changes as expected The issue I'm facing is that although the simulated click event is fired, the setSt ...

Methods for applying responsive design to react modals in React.js

I am looking to make my modal responsive across different media types. In my React JS project, I have implemented custom styles using the following code: import Modal from 'react-modal'; const customStyles = { content : { top ...

When I first began using React with npm, I decided to install create-react-app. However, I encountered difficulty in creating the React folder thereafter

My initial attempt was to install create-react-app globally by using the command `npm install -g create-react-app`. Following that, I tried running `create-react-app myapp`, but unfortunately encountered the same error as shown in the image below. Subseque ...

Ensure that a child div is displayed above the parent div that is absolutely positioned

Is it possible to have a child div within an absolutely positioned parent div appear above its parent, aligned in such a way that the top of the child div aligns with the bottom of the parent div, while also being displayed above neighboring parent divs on ...

Apollo: An Abundance of Mutations

I'm struggling to find the right solution. I need assistance with incorporating two mutations in my export default. Unfortunately, I'm unsure of the correct approach to achieve this. Current code: import React from 'react'; import gq ...

Is there a way to attach HTML buttons to the bottom of their respective cards?

I am currently in the process of creating a directory website. To build it, I chose the Jekyll Moonwalk theme as a solid foundation and am customizing it heavily to suit my requirements. Since this is my inaugural website project, I'm learning as I p ...

Merging Dates Array transforms the date located at the final index of the array

I have created a function that takes a Date object and a count as arguments and returns an array of Date objects starting from the given 'date' for 'count' times. However, I encountered an issue while working on the next part of the cod ...

Is there a way to place the icon on the right side of the @mui/Chip component?

Currently, I am working with MUI version 5.15.0. I have a component called Chip, and my goal is to display the icon after the label on the right side. I attempted to use the CSS rule - .MuiChip-icon{ order:1 }, but it resulted in too much spacing. Additio ...