Giter Club home page Giter Club logo

Comments (6)

connorlanigan avatar connorlanigan commented on May 26, 2024

Hello, thank you for reaching out. Can you tell us more about your use case for this? In what case do you want to disable the wrapping? (There are potentially other components that would fit, such as the Grid component)

from components.

AlexSKuznetsov avatar AlexSKuznetsov commented on May 26, 2024

Hi, I'm using SpaceBetween component in a table column like this, and if viewport became a little bit smaller then Box component move to another row. I can wrap it with a simple div with custom style but I want just use basic Cloudscape components whatever it possible.

       <SpaceBetween size="xs" direction="horizontal" alignItems="center">
          {item.status === 'Blocked' && (
            <BlockedIcon height={16} width={16} className={style.icon} />
          )}
          <Box
            fontSize="body-m"
            color={
              item.status === 'Blocked'
                ? 'text-status-error'
                : 'text-body-secondary'
            }
          >
            {item.status}
          </Box>
        </SpaceBetween>

from components.

connorlanigan avatar connorlanigan commented on May 26, 2024

From your code snippet, it looks similar to our StatusIndicator component. The StatusIndicator handles all wrapping (and selection of colour and icon) out-of-the-box:
status_indicator

You can also see in our demos how we use the StatusIndicator in a Table column: https://cloudscape.design/examples/react/table.html
table_with_status_indicator

Would that be an option for you to use?

from components.

AlexSKuznetsov avatar AlexSKuznetsov commented on May 26, 2024

Status indicator doesn't provide option for the custom Icon but we have a custom Icon here.
If Status indicator will provide api for custom icon it will help also.

from components.

connorlanigan avatar connorlanigan commented on May 26, 2024

I've discussed your request with the team. We'd recommend that you remove the SpaceBetween, and use the browser's regular inline layout with a space character instead:

<div>
  <Icon name="star" variant="error" />{" "}
  <Box fontSize="body-m" color="text-status-error" display="inline">
    Blocked
  </Box>
</div>

example

The SpaceBetween component is intended for laying out blocks of content (for example, multiple Buttons), not for regular inline content such as text.

from components.

AlexSKuznetsov avatar AlexSKuznetsov commented on May 26, 2024

That what I talking about.
I need to wrap my component into div and add classname with 'nowrap'.
I thought that since Space between component having Flex attribute it will convenient to add 'no-wrap' props to it.

from components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.