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

[Draft] Box Component #6980

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

[Draft] Box Component #6980

wants to merge 3 commits into from

Conversation

ggdouglas
Copy link
Contributor

@ggdouglas ggdouglas commented Sep 16, 2024

Changes proposed in this pull request:

This PR introduces a new <Box> component, providing flexible layout utilities for margin, padding, alignment, and positioning. The component is highly customizable and supports dynamic generation of class names based on a set of configurable props.

CleanShot 2024-09-17 at 13 59 33@2x

This component provides flexible and reusable spacing utilities that integrate seamlessly with Blueprint components, allowing for consistent alignment of smaller components within a broader layout structure.

For instance, multiple Buttons can be arranged horizontally:

<Box display="flex" gap={2}>
  <Button intent="primary">Button</Button>
  <Button intent="success">Button</Button>
  <Button intent="warning">Button</Button>
  <Button intent="danger">Button</Button>
</Box>

CleanShot 2024-09-17 at 14 42 02@2x

Or stacked vertically:

<Box display="flex" flexDirection="column" alignItems="center" gap={2}>
  <Button intent="primary">Button</Button>
  <Button intent="success">Button</Button>
  <Button intent="warning">Button</Button>
  <Button intent="danger">Button</Button>
</Box>

CleanShot 2024-09-17 at 14 44 20@2x

It can also be used to create more molecular components (such as EntityTitle):

<Box display="flex" gap={2}>
  <Icon className={Classes.TEXT_MUTED} icon="shop" />
  Buy groceries on my way home
  <Box as={Tag} intent="danger" minimal={true} ml="auto">
    Due today
  </Box>
</Box>

CleanShot 2024-09-17 at 14 56 02@2x

@svc-palantir-github
Copy link

Update ExampleCard to use Box

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@svc-palantir-github
Copy link

Update ExampleCard to use Box

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@svc-palantir-github
Copy link

Add tests for Box

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@palantir palantir deleted a comment from changelog-app bot Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants