Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d-flex doesn't render horizontally #5692

Open
nazarifard opened this issue Feb 12, 2025 · 3 comments
Open

d-flex doesn't render horizontally #5692

nazarifard opened this issue Feb 12, 2025 · 3 comments
Labels
bug Something isn't working react

Comments

@nazarifard
Copy link

Description

instead of a horizontal layout, the items are arranged vertically

Steps to reproduce

  <Box className="container">
      <Box className="d-flex flex-row grid-cols-3 gap-2 p-3"> {/* Incorrect behavior */}
        <Box className="border p-3">Item 1</Box>
        <Box className="border p-3">Item 2</Box>
        <Box className="border p-3">Item 3</Box>
      </Box>
      </Box>

Version

v37.12.0

Browser

Chrome, Edge

@nazarifard nazarifard added the bug Something isn't working label Feb 12, 2025
@NikhilChandK
Copy link

NikhilChandK commented Feb 13, 2025

If you want a horizontal flexbox layout, remove grid-cols-3 and rely only on d-flex flex-row:

<Box className="container">
   <Box className="d-flex flex-row gap-2 p-3"> 
     <Box className="border p-3">Item 1</Box>
     <Box className="border p-3">Item 2</Box>
     <Box className="border p-3">Item 3</Box>
   </Box>
</Box>

If you prefer a grid layout, remove d-flex flex-row and use Tailwind's grid system properly:

<Box className="container">
   <Box className="grid grid-cols-3 gap-2 p-3"> 
     <Box className="border p-3">Item 1</Box>
     <Box className="border p-3">Item 2</Box>
     <Box className="border p-3">Item 3</Box>
   </Box>
</Box>
  • d-flex flex-row ensures a horizontal flexbox layout.
  • grid grid-cols-3 correctly applies a three-column grid in Tailwind.

@nazarifard
Copy link
Author

<Box className="container">
  <Box className="d-flex flex-row"> 
    <Box >Item 1</Box>
    <Box >Item 2</Box>
    <Box >Item 3</Box>
  </Box>
</Box>

doesn't work.

@Player1270606
Copy link

Player1270606 commented Feb 15, 2025

### ###

Item 1 Item 2 Item 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working react
Projects
None yet
Development

No branches or pull requests

3 participants