Skip to content

v0.2.3: Slider Improvements with Vertical Orientation

Choose a tag to compare

@Augani Augani released this 13 Nov 13:07
· 78 commits to main since this release

What's New in v0.2.3

✨ Added

  • Vertical slider orientation support
    • New SliderAxis enum with Horizontal and Vertical variants
    • .vertical() and .horizontal() builder methods
    • Separate rendering logic for horizontal and vertical orientations
    • Vertical sliders grow from bottom to top (0% at bottom, 100% at top)
    • Adaptive thumb shape: horizontal oval for horizontal sliders, vertical oval for vertical sliders
    • update_from_position_vertical() method for proper vertical drag handling

🐛 Fixed

  • Slider thumb vertical centering
    • Container height now matches thumb height for proper alignment
    • Thumb positioned at top: 0 instead of calculated offset
    • Track perfectly centered within container using flex layout
    • Thumb now sits centered on the track line instead of above it

🎨 Improved

  • Slider component architecture with separate render_horizontal() and render_vertical() methods
  • Cleaner positioning logic using container dimensions matching thumb dimensions
  • Better visual consistency across all slider sizes (Sm, Md, Lg)

📚 Examples

  • Updated slider_styled_demo.rs with 10 comprehensive examples
    • 7 horizontal slider variations demonstrating sizes, styling, and features
    • 3 vertical slider examples showcasing the new orientation support
    • All examples fully interactive with drag support and onChange handlers

Installation

Add to your `Cargo.toml`:

```toml
[dependencies]
adabraka-ui = "0.2.3"
```

Or install via cargo:

```bash
cargo add adabraka-ui
```

Crates.io: https://crates.io/crates/adabraka-ui/0.2.3
Documentation: https://docs.rs/adabraka-ui/0.2.3
Full Changelog: v0.2.2...v0.2.3