BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/cubby-ui/number-field

Number Field

cubby-ui/number-field
FreeComponent

A number-field component.

Live preview

live · rendered by the registry
Rendered by cubby-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://cubby-ui.dev/r/number-field.json

Source

registry/default/number-field/number-field.tsxcubby-ui.dev/r/number-field.json · first 6 KB
1"use client";
2
3import { cva, type VariantProps } from "class-variance-authority";
4import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
5import { HugeiconsIcon } from "@hugeicons/react";
6import { ArrowDown01Icon, ArrowUp01Icon } from "@hugeicons/core-free-icons";
7
8import { cn } from "@/lib/utils";
9
10const numberFieldGroupVariants = cva(
11 [
12 "flex rounded-lg",
13 // Outline on the wrapper so focus/invalid rings wrap the full cluster, not just the input.
14 "outline-0 outline-offset-0 outline-transparent transition-[outline-width,outline-offset,outline-color] duration-100 ease-out outline-solid",
15 "has-[[data-slot=number-field-input]:focus-visible]:outline-ring/50 has-[[data-slot=number-field-input]:focus-visible]:outline-2 has-[[data-slot=number-field-input]:focus-visible]:outline-offset-2",
16 "has-[[data-slot=number-field-input][aria-invalid=true]]:outline-destructive/50 has-[[data-slot=number-field-input][aria-invalid=true]]:outline-2 has-[[data-slot=number-field-input][aria-invalid=true]]:outline-offset-2",
17 // With a stacked stepper (no decrement capping the left edge), the input
18 // rounds and borders its own left side automatically.
19 "has-[[data-slot=number-field-stepper]]:[&>[data-slot=number-field-input]]:rounded-l-lg has-[[data-slot=number-field-stepper]]:[&>[data-slot=number-field-input]]:border-l",
20 ],
21 {
22 variants: {
23 variant: {
24 // Opaque base: --outline-hover is a -5% darken, giving a sharp hover delta.
25 default:
26 "[--number-field-bg:var(--input)] [--number-field-hover:var(--outline-hover)]",
27 // Translucent base: --surface-hover is an alpha overlay, preserving translucency.
28 elevated:
29 "[--number-field-bg:var(--input-elevated)] [--number-field-hover:var(--surface-hover)]",
30 },
31 },
32 defaultVariants: {
33 variant: "default",
34 },
35 },
36);
37
38function NumberField({ className, ...props }: BaseNumberField.Root.Props) {
39 return (
40 <BaseNumberField.Root
41 data-slot="number-field"
42 className={cn("flex flex-col items-start gap-1", className)}
43 {...props}
44 />
45 );
46}
47
48function NumberFieldGroup({
49 className,
50 variant,
51 ...props
52}: BaseNumberField.Group.Props &
53 VariantProps<typeof numberFieldGroupVariants>) {
54 return (
55 <BaseNumberField.Group
56 data-slot="number-field-group"
57 className={cn(numberFieldGroupVariants({ variant }), className)}
58// … truncated

What it pulls in

npm packages

  • class-variance-authority
  • @hugeicons/react
  • @hugeicons/core-free-icons

Files it writes

  • registry/default/number-field/number-field.tsx

Facts

Registry
cubby-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on cubby-ui cubby-ui.dev joncoronel/cubby-ui on GitHub Raw registry item This item as JSON

More from cubby-ui

All 79 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordioncubby-uiComponentsFree2 deps
Alertalertcubby-uiComponentsFree1 dep
Alert-dialogalert-dialogcubby-uiComponentsFree2 deps
Aspect-ratioaspect-ratiocubby-uiComponentsFreeno deps
Autocompleteautocompletecubby-uiComponentsFree2 deps
Avataravatarcubby-uiComponentsFree1 dep
Badgebadgecubby-uiComponentsFree1 dep
Base Drawerbase-drawercubby-uiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex