Skip to main content

Module chip

Module chip 

Source
Expand description

Chip / tag widget.

A compact rounded pill with a label + optional removable “x” (stateful when removable, mirrors alert’s dismiss); see chip.rs. Chip / tag widget — a compact rounded “pill” holding a short label plus an optional removable “x” affordance. A blend of crate::widgets::badge::Badge (the coloured pill visual + [ChipKind] colour variants) and crate::widgets::alert::Alert (the dismiss pattern: a stateful close affordance that hides the widget on click).

When made removable (with_removable(true) or set_on_remove), the chip mirrors the stateful pattern of crate::widgets::alert::Alert: it carries a [ChipStateWrapper] ({ visible } + on_remove) in a [RefAny] attached to the “x” node. Clicking “x” flips visible to false, invokes the optional user on_remove, and hides the whole chip by setting display: none on the container via set_css_property (mirroring alert’s live restyle). A non-removable chip renders no “x” and carries no live callback — it is then just a stateless styled pill (a near-clone of [Badge]).

Key types: [Chip], [ChipKind], [ChipState], [ChipOnRemove], [ChipOnClick].

Structs§

Chip
A compact rounded pill holding a label plus an optional removable “x”.
ChipOnClick
ChipOnClickCallback
ChipOnRemove
ChipOnRemoveCallback
ChipState
The visible/hidden state of a Chip.
ChipStateWrapper

Enums§

ChipKind
The semantic colour variant of a Chip (mirrors badge::BadgeKind).
OptionChipOnClick
OptionChipOnRemove

Statics§

CHIP_ON_CLICK_INVOKER
Process-global slot for this callback kind’s host-side invoker.
CHIP_ON_REMOVE_INVOKER
Process-global slot for this callback kind’s host-side invoker.

Functions§

AzApp_setChipOnClickCallbackInvoker
Register the host-side invoker for this callback kind.
AzApp_setChipOnRemoveCallbackInvoker
Register the host-side invoker for this callback kind.
AzChipOnClickCallback_createFromHostHandle
C-ABI export wrapping <Wrapper>::create_from_host_handle.
AzChipOnRemoveCallback_createFromHostHandle
C-ABI export wrapping <Wrapper>::create_from_host_handle.

Type Aliases§

AzChipOnClickCallbackInvoker
Pointer-arg variant of this callback kind’s typedef.
AzChipOnRemoveCallbackInvoker
Pointer-arg variant of this callback kind’s typedef.
ChipOnClickCallbackType
Callback function type invoked when the chip’s label area is clicked.
ChipOnRemoveCallbackType
Callback function type invoked when a removable chip’s “x” is clicked.