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

Near Miss Search

Search by meaning that keeps what nearly matched. Clear matches sit in front; the near misses wait softly behind them.

Needs: Image embeddings and a text embedder in the same space (CLIP's two towers, or any multimodal embedding API). The preview runs quantised CLIP ViT-B/32 (downloaded once, in the browser) in a worker and caches the photos' embeddings locally.

Customize

Props

PropTypeDefaultDescription
items{ id: string; src: string; alt?: string; embedding?: ArrayLike<number> }[]requiredThe photos. An item without an embedding yet shows under Recent but isn't searched.
embed(text: string) => Promise<ArrayLike<number>>requiredText to vector, in the same space as the photos. Called for the whole query and for each of its parts, and cached. Keep it stable: a new function searches again.
querystring–Controlled query. Leave it out and the component keeps its own.
onQueryChange(query: string) => void–Called as the query is typed or cleared.
placeholderstring"Search your photos"In the empty field, and its accessible name.
columnsnumber4Tiles per row.
recentnumber12How many photos to show before anything is typed.
floornumber–A cosine the best photo can reach to count as plain evidence even when the ranking slopes gently. Model-specific: about 0.27 for CLIP ViT-B/32. Leave it out to decide on the gap alone.
onOpen(item: NearMissItem) => void–Called when a match or a recent photo is opened.
classNamestring""Extra class on the root.
styleCSSProperties–Inline style on the root. Set --mlui-gap for the space between tiles.
← Likeness GridRain Drops →