Jetpack Compose: Hiding TextField Cursor, Cursor Handle, and Text Toolbar

Abhimanyu
Make Apps Simple
Published in
2 min readSep 10, 2022

Let me start by explaining what these components are.

  • TextToolbar: The Toolbar which had the Copy & Cut options are called TextToolbar .
  • Cursor handle: The two drops at the bottom of the text are called Cursor handle .
  • Cursor : The black line that blinks till the text field is focused.

When we want to create a customized TextField , we might have requirements to remove/hide these.

Cursor

We can use cursorBrush property to change the cursor color to Transparent like this,

TextToolbar

For TextToolbar , we can use CompositionLocalProvider to change it from the default one.

Cursor Handle

For Curso handle also, we can make use of CompositionLocalProvider to change it from the default one.

Sample Code

Please comment with your valuable feedback. It would help me to improvise.

Kindly 👏👏👏 if this was useful.

Please follow if you would like to see more content related to Android Jetpack Compose.

LinkedIn: https://www.linkedin.com/in/abhimanyu-n/

--

--