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

Sticker Lift

Tap the subject and it lifts off the photo as a sticker with a white die-cut edge. Slide to choose how much of it you take: a detail, a part or the whole thing.

Needs: A promptable segmenter that returns candidate masks as logits with a predicted IoU each. The preview runs SlimSAM (about 14 MB, downloaded in the browser) in a worker; the first look at a photo takes 20 to 30 seconds, every tap after that is instant.

Customize

photo

Props

PropTypeDefaultDescription
srcstringrequiredThe photo. Same-origin or CORS-enabled: the sticker is cut from its pixels.
segment(points: LiftPoint[]) => Promise<LiftMasks>requiredRuns the segmenter. Called with every point so far ({ x, y } as fractions, positive false for "not this"); resolve with { masks: Float32Array[] of logits, width, height, scores }. The newest call wins.
altstring""What the photo shows, read out with the controls.
dropTargetRefObject<HTMLElement | null>–Where a sticker can be dropped, such as a chat. It gets data-mlui-over while a sticker hovers it; with onDrop, a Send button appears too.
onDrop(sticker: Sticker) => void–Called with { blob, width, height, label } when the sticker is dropped on dropTarget or sent with the button. The blob is a transparent PNG with its border.
loadingstring | null–While the model gets ready, what it is doing; shown over the photo. Taps still count and wait for it.
progressnumber | null–How far along loading is, 0 to 1, when that is known.
bordernumber6Width of the white die-cut border, in CSS pixels.
offsetnumber1How far, in logits, the threshold moves to test whether an edge is stable. SAM uses 1; higher calls more edges soft.
classNamestring""Extra class on the root.
styleCSSProperties–Inline style on the root. Set --mlui-radius for the photo's corners.
← Spending SortTaste Ledger →