Skip to main content

SelectionContainer

Function SelectionContainer 

Source
pub fn SelectionContainer(__arg0: Modifier, content: impl FnMut() + 'static)
Expand description

Lets users select and copy text across the content. A mouse drag selects a range; double and triple clicks select a word and a line. A touch hold starts selection and a release opens the text menu. Ctrl+C and Ctrl+A use the copy and select-all actions; macOS uses Cmd. Escape clears the selection.

Wrap excluded content in DisableSelection.

ยงExample

use cranpose_ui::{widgets::SelectionContainer, *};

#[composable]
fn Article() {
    SelectionContainer(Modifier::empty(), || {
        Text(
            "Select and copy this text.",
            Modifier::empty(),
            TextStyle::default(),
        );
    });
}