HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / UI

Dot Switch

A pill of dots and a key for the knob. Flip it and the knob slides across with a little bounce while the accent dissolves into the track behind it, dot by dot, and out again when it's turned off; the knob stretches while it's pressed. A real checkbox with the switch role lies under it, so Space and screen readers work, and its label is a real label.

Needs: None. Canvas 2D over a native checkbox.

Customize

Props

PropTypeDefaultDescription
checkedboolean–On or off. Leave unset to let the switch keep its own.
defaultCheckedbooleanfalseOn or off at first, when checked isn't set.
onChange(checked: boolean) => void–Called with the new state when it's flipped.
childrenReactNode–The label beside it. Clicking it flips the switch too.
tonestring–The track's colour when on. The page's accent by default.
pitchnumber3Size of one dot in px. The switch is 17 by 11 dots.
disabledbooleanfalseCan't be flipped.
labelstring–For screen readers, when there's no visible label.
classNamestring–Class on the switch's label.
styleCSSProperties–Style on the switch's label.
← Dot StepperDot Tabs →