Browse documentation
Reference / Interactivity
Caret color
Choose the color of the text insertion caret independently of the surrounding text color.
Working example
Focus the field to see the caret. Choose a color that remains visible against the field background as the user types.
<label class="block">Running title
<input class="mt-1 block w-full border bg-neutral-900 p-2 text-white caret-white" value="Collected editions">
</label>Class reference
| Class | CSS declarations |
|---|---|
caret-black | caret-color: #000; |
caret-white | caret-color: #fff; |
caret-current | caret-color: currentColor; |
caret-neutral-600 | caret-color: oklch(0.56 0 0); |
View full generated CSS
.caret-black {
caret-color: #000;
}
.caret-current {
caret-color: currentColor;
}
.caret-neutral-600 {
caret-color: oklch(0.56 0 0);
}
.caret-white {
caret-color: #fff;
}