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 / AI

Context Meter

A slim capsule showing what fills the model's context: system prompt, files, conversation, the reply. Each part is a step of one ink, with the free space at the end.

Needs: Token counts from your own tokenizer or the API's usage numbers. No model in the browser.

Customize

size

Props

PropTypeDefaultDescription
used{ label: string; tokens: number }[]requiredWhat's in the window, in order. Earlier parts are darker; over the limit, the parts share the whole bar.
limitnumber128000The model's context window, in tokens. Set it to your model's.
size"sm" | "md" | "lg""md"Bar thickness, width and type size: 200, 280 or 420 px wide at most, filling narrower containers.
accentstring""Any CSS colour for the segments; each part is a lighter step of it. The text colour when empty.
wordsPerTokennumber0.75Turns free tokens into words for the estimate (pages are 500 words). About 0.75 for English, lower for code or other scripts.
labelstring"Context window"Names the meter for screen readers, which hear the same words as the label.
classNamestring–Added to the root element.
styleCSSProperties–Inline styles on the root; set --mlui-* variables here to theme it.
← Confidence GlassDiffusion Image →