pub struct Chip { /* private fields */ }Expand description
A filter/tag chip that toggles — brought to the Quality Bar.
- States — unselected/selected · hover · pressed · focus-visible · disabled.
- Motion — the fill + text recolor ease on select; a state-layer wash fades on hover/press/focus (two channels).
- Theming — unselected = outlined
surface_variant, selected =primaryfill with high-contrast text; tokens, overridable. - A11y — checkbox-style role (toggles) + label + value.
- Interactive-by-identity — always owns its hit region.
Implementations§
Source§impl Chip
impl Chip
pub fn new(label: impl Into<String>) -> Self
pub fn selected(self) -> Self
pub fn selected_if(self, c: bool) -> Self
pub fn disabled(self) -> Self
Trait Implementations§
Source§impl Widget for Chip
impl Widget for Chip
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Chip
impl !UnwindSafe for Chip
impl Freeze for Chip
impl Send for Chip
impl Sync for Chip
impl Unpin for Chip
impl UnsafeUnpin for Chip
Blanket Implementations§
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
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.