ChromaDial elegantly abstracts complex circular geometry into a developer-friendly API for Jetpack Compose. It is a sophisticated tool that turns niche interaction design into a seamless, multiplatform reality.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Slider Dial in Jetpack ComposeAdded:
With a center point and a given radius, you could calculate a user's touch in degrees using the arc tangent of the current offset. With this, you can build a dial that can slide around a track.
Or you could use chroma dial.
Chrommaile is my compos multiplatform library that makes creating delightful dials easy.
We add it into our project in our build.gradal file and then render it like any other composible.
Its function signature is inspired by material slider. So it takes in a degree state and a callback function.
This gives us the default dial which has a thumb that we can move around the track a full 360° starting from the 12:00 position.
If we want a different range, we can first change the starting point with start degrees. Then we can define the total amount possible with sweep degrees.
The default dial also has support for a sweep larger than 360°.
In addition to the range, we can also pass an interval which will provide snapping points after every 10°. With the default dial, we can customize the colors using dial colors.
But if you want something fancier, we can fully customize the thumb and track by passing in composables for them.
For both of these, the dial state is very crucial since it will give us information that we will use to draw the thumb and track. Inside the thumb composible, we can add any design we can think of. Keep in mind that the thumb directly affects the size of the touch target that the user can drag on the dial.
This means if you want to go for a minimal look without any thumb, you would still need to define a box with a specified size.
When you add text on the thumb, you will notice that it rotates as it moves around the track and can end up upside down.
We can use the dial state to rotate the text to be always right side up.
To add some user feedback, we can use the interaction source to know when the thumb is being dragged and add some animation to it.
Next we have the track which we can indicate with a canvas draw arc function. We just use the degrees in dial state to know how far the ark should extend. But the default function is too verbose. First we have to subtract 90° since the 0° point of the canvas function is at 3:00 rather than 12:00.
Second, we have to define the layout with XY offset plus width and height.
Chromodile provides its own convenient draw arc function that takes in center and radius and offsets the starting point to 12:00. So, we do not need to subtract 90. Finally, Chromadile provides an easy API for us to draw arbitrary elements around the dial like numbers on a gauge or a clock face. Draw every interval takes in some interval plus a radius, center, start, and sweep degrees. It then invokes a callback for each iteration.
It gives rotation and position data which we can use to place the items.
This function is useful for various additions like adding numbers, icons or graduations which give your dial extra detail.
For more delightful UI, go to sasamaki.com.
Thanks for watching and see you next time.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











