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

Slider orientation vertical #2800

Open
Voten641 opened this issue Mar 24, 2024 · 1 comment
Open

Slider orientation vertical #2800

Voten641 opened this issue Mar 24, 2024 · 1 comment

Comments

@Voten641
Copy link

Voten641 commented Mar 24, 2024

Bug report

Current Behavior

Slider when it has orientation vertical can be moved from top to bottom but only like couple px, and the bar is still horizontal
image

Expected behavior

Should be vertical

Reproducible example

CodeSandbox Template

Additional context

it also dont work in vue and in electron

Your environment

electron

@FredrikMWold
Copy link

Your issue is with the styles not the radix primatives. You need to swap all height -> widths and widths -> height and change to flex-direction: column;

Here are some example styles from the radix documentation:
https://www.radix-ui.com/primitives/docs/components/slider#slider

/* styles.css */
.SliderRoot {
  position: relative;
  display: flex;
  align-items: center;
}
.SliderRoot[data-orientation='vertical'] {
  flex-direction: column;
  width: 20px;
  height: 100px;
}

.SliderTrack {
  position: relative;
  flex-grow: 1;
  background-color: grey;
}
.SliderTrack[data-orientation='vertical'] {
  width: 3px;
}

.SliderRange {
  position: absolute;
  background-color: black;
}
.SliderRange[data-orientation='vertical'] {
  width: 100%;
}

.SliderThumb {
  display: block;
  width: 20px;
  height: 20px;
  background-color: black;
}

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

No branches or pull requests

2 participants