Skip to main content

Springs

Enum Springs 

Source
pub enum Springs {}
Expand description

The set of springs in the Material specification.

Material 3 Expressive motion uses springs, grouped into two motion schemes. The standard scheme eases into place with minimal bounce, and suits more utilitarian products. The expressive scheme overshoots and bounces into place, and suits hero moments and key interactions.

Each scheme has springs for two types of motion, in three speeds: default, fast, and slow.

  • Spatial springs animate movement, such as position, size, rotation, and corner radius.
  • Effects springs animate properties that shouldn’t overshoot, such as color and opacity.

Most motion should use the default speed. Smaller elements can use the fast speed, and larger elements can use the slow speed.

Material spring tokens define a stiffness and a damping ratio, but no mass. The Material token named damping is the damping ratio (ζ), not SpringDescription.damping. Each constant is the same as SpringDescription.withDampingRatio with a mass of 1.0 and the token’s stiffness and damping ratio, so its damping is ratio * 2.0 * sqrt(stiffness). For example, STANDARD_DEFAULT_SPATIAL has a damping of 0.9 * 2.0 * sqrt(700.0), about 47.62.

Use them with a SpringSimulation, for example through AnimationController.animateWith.

See also:

Implementations§

Source§

impl Springs

Source

pub const STANDARD_DEFAULT_SPATIAL: SpringDescription

The standard default spatial spring in the Material specification.

It has a stiffness of 700.0 and a damping ratio of 0.9.

See also:

Source

pub const STANDARD_FAST_SPATIAL: SpringDescription

The standard fast spatial spring in the Material specification.

It has a stiffness of 1400.0 and a damping ratio of 0.9.

See also:

Source

pub const STANDARD_SLOW_SPATIAL: SpringDescription

The standard slow spatial spring in the Material specification.

It has a stiffness of 300.0 and a damping ratio of 0.9.

See also:

Source

pub const STANDARD_DEFAULT_EFFECTS: SpringDescription

The standard default effects spring in the Material specification.

It has a stiffness of 1600.0 and a damping ratio of 1.0.

See also:

Source

pub const STANDARD_FAST_EFFECTS: SpringDescription

The standard fast effects spring in the Material specification.

It has a stiffness of 3800.0 and a damping ratio of 1.0.

See also:

Source

pub const STANDARD_SLOW_EFFECTS: SpringDescription

The standard slow effects spring in the Material specification.

It has a stiffness of 800.0 and a damping ratio of 1.0.

See also:

Source

pub const EXPRESSIVE_DEFAULT_SPATIAL: SpringDescription

The expressive default spatial spring in the Material specification.

It has a stiffness of 380.0 and a damping ratio of 0.8.

See also:

Source

pub const EXPRESSIVE_FAST_SPATIAL: SpringDescription

The expressive fast spatial spring in the Material specification.

It has a stiffness of 800.0 and a damping ratio of 0.6.

See also:

Source

pub const EXPRESSIVE_SLOW_SPATIAL: SpringDescription

The expressive slow spatial spring in the Material specification.

It has a stiffness of 200.0 and a damping ratio of 0.8.

See also:

Source

pub const EXPRESSIVE_DEFAULT_EFFECTS: SpringDescription

The expressive default effects spring in the Material specification.

It has a stiffness of 1600.0 and a damping ratio of 1.0.

See also:

Source

pub const EXPRESSIVE_FAST_EFFECTS: SpringDescription

The expressive fast effects spring in the Material specification.

It has a stiffness of 3800.0 and a damping ratio of 1.0.

See also:

Source

pub const EXPRESSIVE_SLOW_EFFECTS: SpringDescription

The expressive slow effects spring in the Material specification.

It has a stiffness of 800.0 and a damping ratio of 1.0.

See also:

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,