pub fn checkmark(args: impl Into<CheckmarkArgs>)
Expand description
Renders a checkmark, a visual indicator that is displayed when in a checked
state.
This component is a GPU-rendered checkmark that provides a smooth, animated alternative to traditional emoji or icon-based checkmarks. It supports customization of color, stroke width, and animation progress.
§Arguments
The args
parameter accepts any value that can be converted into CheckmarkArgs
,
including a CheckmarkArgs
struct or its builder.
color
: TheColor
of the checkmark stroke. Defaults to a green color.stroke_width
: The width of the checkmark stroke in pixels. Defaults to5.0
.progress
: The animation progress for drawing the checkmark, from0.0
(not drawn) to1.0
(fully drawn). Defaults to1.0
.padding
: The padding[horizontal, vertical]
around the checkmark within its bounds. Defaults to[2.0, 2.0]
.size
: The size of the checkmark area as aDp
value. Defaults toDp(20.0)
.
§Example
use tessera_ui::Color;
use tessera_ui_basic_components::checkmark::{checkmark, CheckmarkArgs};
checkmark(CheckmarkArgs {
color: Color::from_rgb(0.0, 0.7, 0.0),
..Default::default()
});