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

Token Stream

Text that arrives the way a model writes it, token by token, in real clumps and stalls. Each token lands at full ink and dries to how likely it was.

Needs: Nothing. Real token probabilities (logprobs) or a live stream are optional.

Customize

mode

Props

PropTypeDefaultDescription
textstringrequiredThe reply, cut into word-piece tokens with seeded, simulated probabilities. Leave it out when you pass tokens or stream.
tokens{ text: string; p?: number }[]–Real tokens with their probabilities (exp of the logprob). Leading whitespace belongs to the token after it. Wins over text.
streamAsyncIterable<string | { text: string; p?: number }>–A live stream. Plain strings are shown at full ink, since nothing says how likely they were. Wins over both.
speednumber24Tokens a second. A live stream is paced to it, and catches up when it falls behind.
jitternumber0.50 to 1: how bursty the simulated stream is. 0 is a metronome; real streams clump and stall.
inkFloornumber0.35Ink of the least likely tokens, 0 to 1.
mode"probability" | "plain""probability""plain" sets every token at full ink, for when probabilities would only distract.
caretbooleantrueA soft caret leading the stream.
loopbooleanfalseStart again a moment after finishing. Ignored for a live stream.
sizenumber | string32Font size in px, or any CSS length such as "clamp(28px, 6vw, 56px)".
colorstring""Ink colour, any CSS colour. Left unset, the theme's foreground (--mlui-fg), so dark mode just works.
caretColorstring–Caret colour. The ink colour by default.
onDone() => void–Called once the last token has landed, each time round when looping.
seednumber1Seed for the simulated probabilities and timing.
classNamestring–Class on the root.
styleCSSProperties–Inline style on the root.
← Token MeterWord Alternatives →