Skip to content

feat: responsive capacities based on breakpoints #5322

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

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

matthprost
Copy link
Collaborator

@matthprost matthprost commented Jul 3, 2025

Introducing Responsive

Our current components allow us to structure and format correctly data on screen but never had the possibility to react depending on screen size. This is now part of history.

All the responsive is based on our breakpoints defined in the theme:

breakpoints: {
    large: '1440px',
    medium: '1280px',
    small: '1080px',
    xlarge: '1800px',
    xsmall: '720px',
    xxsmall: '320px',
}

Stack

Stack component will now allow you to use an object on gap and direction to define the values you want to each screen size.

The previous system remains functional and has now become the standard method for globally determining what to display, regardless of screen size.

// apply gap and direction for all screen size
<Stack
   direction="column"
   gap={1}
>
   <div>First child</div>
   <div data-width-full>Second child</div>
   <div>Third child</div>
</Stack>
// apply gap and direction depending on screen size
<Stack
   direction={{ xxsmall: 'column', xsmall: 'row', small: 'row' }}
   gap={{ xxsmall: 1, xsmall: 2, small: 3 }}
>
   <div>First child</div>
   <div data-width-full>Second child</div>
   <div>Third child</div>
</Stack>

Screen Recording 2025-07-03 at 14 57 12

Row

Row component will also allow you to use an object on gap and templateColumns. As for the Stack the previous system still remains functional.

// apply gap and templateColumns for all screen size
<Row
    templateColumns="4fr 3fr 4fr"
    gap={1}
>
   <div>row</div>
   <div>row</div>
   <div>row</div>
</Row>
// apply gap and templateColumns depending on screen size
<Row
   templateColumns={{
     xxsmall: '1fr',
     xsmall: '2fr 2fr 2fr',
     small: '4fr 3fr 4fr',
   }}
   gap={{
     xxsmall: 1,
     xsmall: 1,
     small: 2,
   }}
>
   <div>row</div>
   <div>row</div>
   <div>row</div>
</Row>

Screen Recording 2025-07-03 at 14 58 18

@matthprost matthprost self-assigned this Jul 3, 2025
@matthprost matthprost requested review from johnrazeur, a team and lisalupi as code owners July 3, 2025 13:52
@matthprost matthprost added the enhancement New feature or request label Jul 3, 2025
Copy link

changeset-bot bot commented Jul 3, 2025

🦋 Changeset detected

Latest commit: 378806d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@ultraviolet/themes Major
@ultraviolet/ui Minor
@ultraviolet/form Major
@ultraviolet/icons Patch
@ultraviolet/illustrations Patch
@ultraviolet/plus Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants