m3e/swipe_reveal
SwipeReveal is reveals contextual actions behind content when swiped, and optionally dismisses the item.
This file was generated by m3e/generator
DO NOT EDIT
Types
Config is a public record for configuring this component.
pub type Config {
Config(
dismissible: swipe_reveal_dismiss.SwipeRevealDismiss,
elastic: swipe_reveal_elastic.SwipeRevealElastic,
dismiss_threshold: Float,
overshoot: Float,
stagger: Float,
stagger_count: Float,
threshold: Float,
triggers: List(swipe_reveal_trigger.SwipeRevealTrigger),
)
}
Constructors
-
Config( dismissible: swipe_reveal_dismiss.SwipeRevealDismiss, elastic: swipe_reveal_elastic.SwipeRevealElastic, dismiss_threshold: Float, overshoot: Float, stagger: Float, stagger_count: Float, threshold: Float, triggers: List(swipe_reveal_trigger.SwipeRevealTrigger), )
Slots are used in child elements to insert content into this component
pub type Slot {
Leading
Trailing
}
Constructors
-
Leading -
Trailing
SwipeReveal is a View Model for this component
Fields:
- dismissible: The sides whose swipe can continue past the actions to dismiss the item. The outermost action on a side grows to fill the space as the item is dragged toward dismissal.
- elastic: The sides whose actions squish and grow as the content is dragged. When a side is not elastic, its actions keep their size and its container does not grow with overshoot.
- dismiss_threshold: The fraction (0 to 1) of the item’s width it must be dragged to dismiss it on release.
- overshoot: The maximum distance (px) content can be dragged past fully revealing its actions.
Buttons grow with the overshoot. Set to
0to disable. - stagger: How far (0 to 1) a nearest sibling follows a dragged item. Each further sibling
follows by half as much as the previous. A value of
0disables staggering. - stagger_count: The maximum number of siblings, on each side, to stagger.
- threshold: The fraction (0 to 1) of an actions’ width content must be dragged to reveal. Closing a revealed item uses the same fraction in reverse.
- triggers: The gestures used to reveal actions.
pub opaque type SwipeReveal
Values
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_dismiss_threshold: Float
pub const default_dismissible: swipe_reveal_dismiss.SwipeRevealDismiss
pub const default_elastic: swipe_reveal_elastic.SwipeRevealElastic
pub const default_overshoot: Float
pub const default_stagger: Float
pub const default_stagger_count: Float
pub const default_threshold: Float
pub const default_triggers: List(
swipe_reveal_trigger.SwipeRevealTrigger,
)
pub fn dismiss_threshold(
record: SwipeReveal,
dismiss_threshold: Float,
) -> SwipeReveal
dismiss_threshold sets the value of dismiss_threshold for this SwipeReveal.
pub fn dismissible(
record: SwipeReveal,
dismissible: swipe_reveal_dismiss.SwipeRevealDismiss,
) -> SwipeReveal
dismissible sets the value of dismissible for this SwipeReveal.
pub fn elastic(
record: SwipeReveal,
elastic: swipe_reveal_elastic.SwipeRevealElastic,
) -> SwipeReveal
elastic sets the value of elastic for this SwipeReveal.
pub fn from_config(config: Config) -> SwipeReveal
from_config creates a new SwipeReveal from the given configuration.
pub fn overshoot(
record: SwipeReveal,
overshoot: Float,
) -> SwipeReveal
overshoot sets the value of overshoot for this SwipeReveal.
pub fn render(
model: SwipeReveal,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a SwipeReveal
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a SwipeReveal Config
pub fn slot(s: Slot) -> attribute.Attribute(msg)
slot returns a Lustre Attribute(msg) for the given slot name
pub fn stagger(
record: SwipeReveal,
stagger: Float,
) -> SwipeReveal
stagger sets the value of stagger for this SwipeReveal.
pub fn stagger_count(
record: SwipeReveal,
stagger_count: Float,
) -> SwipeReveal
stagger_count sets the value of stagger_count for this SwipeReveal.
pub fn threshold(
record: SwipeReveal,
threshold: Float,
) -> SwipeReveal
threshold sets the value of threshold for this SwipeReveal.
pub fn triggers(
record: SwipeReveal,
triggers: List(swipe_reveal_trigger.SwipeRevealTrigger),
) -> SwipeReveal
triggers sets the value of triggers for this SwipeReveal.