Skip to main content

Crate use_breakpoint

Crate use_breakpoint 

Source
Expand description

§use-breakpoint

Viewport and container breakpoint primitives for RustUse UI.

§Purpose

use-breakpoint models named breakpoints, breakpoint ranges, and breakpoint sets for viewport or container sizing semantics. It is not web-specific and does not generate media queries.

§Example

use use_breakpoint::{Breakpoint, BreakpointName, BreakpointRange, BreakpointSet};

let set = BreakpointSet::defaults();
let range = BreakpointRange::new(Some(480), Some(768));

assert_eq!(set.matching(800).map(Breakpoint::name), Some(BreakpointName::Md));
assert!(range.contains(640));
assert!(!range.contains(768));

§Main types

  • Breakpoint
  • BreakpointName
  • BreakpointRange
  • BreakpointSet

§Facade relationship

The use-ui facade exposes this crate as use_ui::breakpoint when the breakpoint or full feature is enabled.

Structs§

Breakpoint
A named breakpoint threshold.
BreakpointRange
Inclusive lower and exclusive upper range for a breakpoint.
BreakpointSet
A collection of breakpoints ordered by threshold.

Enums§

BreakpointName
Standard breakpoint labels.