pub struct Card<V> { /* private fields */ }Expand description
A grouped surface lifted off the canvas: bg-200 fill, radius-xl corners,
shadow-soft and a hairline border, padded by space-6.
Implementations§
Source§impl<V> Card<V>where
V: View,
impl<V> Card<V>where
V: View,
Sourcepub fn new(content: V) -> Card<V>
pub fn new(content: V) -> Card<V>
A card around content with the theme’s surface, radius, shadow and padding.
Sourcepub fn corner_radius(self, radius: f32) -> Card<V>
pub fn corner_radius(self, radius: f32) -> Card<V>
Corner radius in logical pixels (theme radius-xl by default).
Sourcepub fn fill(self, fill: impl Into<Fill>) -> Card<V>
pub fn fill(self, fill: impl Into<Fill>) -> Card<V>
Background, as a theme role (SurfaceElevated by default) or a literal color.
Sourcepub fn border(self, visible: bool) -> Card<V>
pub fn border(self, visible: bool) -> Card<V>
Shows or hides the hairline border (shown by default).
Sourcepub fn on_click(self, handler: impl Fn() + 'static) -> Card<V>
pub fn on_click(self, handler: impl Fn() + 'static) -> Card<V>
Makes the whole card a button: it runs handler when clicked, or on
Enter and Space while focused, and marks hover with the accent.
Sourcepub fn selected(self, selected: bool) -> Card<V>
pub fn selected(self, selected: bool) -> Card<V>
Marks it as the chosen one among others: a thicker accent border and a tint of
the accent, with screen readers told which. Works with or without
Self::on_click, and shows even with Self::border off.
Trait Implementations§
Auto Trait Implementations§
impl<V> !RefUnwindSafe for Card<V>
impl<V> !Send for Card<V>
impl<V> !Sync for Card<V>
impl<V> !UnwindSafe for Card<V>
impl<V> Freeze for Card<V>where
V: Freeze,
impl<V> Unpin for Card<V>where
V: Unpin,
impl<V> UnsafeUnpin for Card<V>where
V: UnsafeUnpin,
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.