Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
9fc0a99
[number field] Create a MUI component from Base UI
silviuaavram Sep 29, 2026
cdee763
finish the root, inputLabel and helperText slots
silviuaavram Sep 29, 2026
adba395
add input slot
silviuaavram Sep 30, 2026
6139b55
prettier
silviuaavram Oct 5, 2026
1a3a2d7
pass the rest of the api
silviuaavram Oct 6, 2026
c5a891a
2 more props passed to root
silviuaavram Oct 6, 2026
97201e4
fix the native input props composition
silviuaavram Oct 6, 2026
f4e82f3
keep base ui children and remove overrides
silviuaavram Oct 6, 2026
7658c86
fix ssr for the input start adornment
silviuaavram Oct 6, 2026
a583b09
support different types for variants
silviuaavram Oct 6, 2026
047d2fd
add propTypes
silviuaavram Oct 6, 2026
5e967b2
prettier
silviuaavram Oct 7, 2026
e4b2d10
some cleanups
silviuaavram Oct 7, 2026
58aa5d5
pass the final disabled, required and readonly to the slots
silviuaavram Oct 7, 2026
3eebadd
simplify proptypes
silviuaavram Oct 7, 2026
5fb602c
ts fixes, docs:api, proptypes
silviuaavram Oct 7, 2026
7370ec3
add types for control position and button slots
silviuaavram Oct 9, 2026
4642768
wip: increment + decrement slots
silviuaavram Oct 9, 2026
17bc126
some renames
silviuaavram Oct 26, 2026
98b61b9
increment / decrement buttons
silviuaavram Oct 26, 2026
909e6e8
fix ssr for the start adornment case
silviuaavram Oct 26, 2026
21017c5
add classes for slots
silviuaavram Oct 26, 2026
8ec3aed
some cleanups
silviuaavram Oct 27, 2026
e53df36
convert test to ts
silviuaavram Oct 27, 2026
cde5511
shouldForwardComponentProp on button slots
silviuaavram Oct 27, 2026
57dbaa2
regroup existing suites
silviuaavram Oct 27, 2026
36a1646
improve existing tests
silviuaavram Oct 27, 2026
528b765
unit tests
silviuaavram Oct 29, 2026
a1373e5
types tests
silviuaavram Oct 29, 2026
55ca62d
update experiment
silviuaavram Oct 29, 2026
6e69767
docs update
silviuaavram Oct 29, 2026
45b4306
replace chevrons with + / -
silviuaavram Oct 29, 2026
7a9295f
scrubbing area
silviuaavram Oct 30, 2026
4f8cf56
fix imports for types
silviuaavram Oct 31, 2026
1712b9a
chevrons example
silviuaavram Nov 4, 2026
10837a8
switch - and + positions
silviuaavram Nov 4, 2026
9aa9830
prettier
silviuaavram Nov 4, 2026
f3d9577
pass form to input as well
silviuaavram Nov 4, 2026
1473420
add ability to pass nativeButton prop for non button controls
silviuaavram Nov 5, 2026
72af677
api fixes and improvements
silviuaavram Nov 5, 2026
527f665
remove extra padding
silviuaavram Nov 5, 2026
29d9e56
make buttons compact
silviuaavram Nov 5, 2026
5cee226
fix unit tests with a base ui related wait
silviuaavram Nov 5, 2026
7690a12
add stacked, removed start, tidy up visually
silviuaavram Nov 9, 2026
13ff881
improve scrubbing area example
silviuaavram Nov 9, 2026
3065e3e
fix the double callback calls with preventDefault
silviuaavram Nov 10, 2026
79ab173
accept false for controlsPosition
silviuaavram Nov 10, 2026
bc89889
improved handling for invalid controlsPosition
silviuaavram Nov 10, 2026
46c5947
various claude suggested improvements
silviuaavram Nov 10, 2026
6958877
fix placeholder ending on the root
silviuaavram Nov 11, 2026
dcfbfbe
remove ControlsPosition from public API
silviuaavram Nov 11, 2026
2b91a35
add button base migration guide and handle space like enter
silviuaavram Nov 11, 2026
3c816f7
cleanup duplicated tests
silviuaavram Nov 11, 2026
445ddd4
consolidate isNonNativeActivation
silviuaavram Nov 11, 2026
eeac192
move startAdornment logic to getControlElements
silviuaavram Nov 11, 2026
654aa1c
fix imports
silviuaavram Nov 11, 2026
0b515af
remove className duplication
silviuaavram Nov 11, 2026
7d2dddb
resolve owner state and external forwared props before passing to roo…
silviuaavram Nov 11, 2026
0c49dc6
remove console.error, pass classes to slots, remove children type
silviuaavram Nov 11, 2026
72c2e3a
updated scenarios from the outdated FieldDemo
silviuaavram Nov 11, 2026
cafb225
improve props descriptions
silviuaavram Nov 11, 2026
fb90f23
improve the docs for a11y and props precedence
silviuaavram Nov 11, 2026
e530236
tidy up the docs
silviuaavram Nov 12, 2026
0e1db81
update pnpm lock
silviuaavram Nov 12, 2026
3964253
improvements to prop name, coverage, simplifications and types
silviuaavram Nov 12, 2026
f433c1b
consistent sizes and dark mode theme overrides
silviuaavram Nov 12, 2026
9f8ed1b
useTheme in number field theme overrides
silviuaavram Nov 13, 2026
e22ed8e
replace root component with render
silviuaavram Nov 17, 2026
252e39c
use render instead of component for input and htmlinput
silviuaavram Nov 17, 2026
bfca5aa
replace component with render for buttons
silviuaavram Nov 17, 2026
6d70ecc
use render instead of component for the rest of the slots
silviuaavram Nov 17, 2026
72ef17b
add controls slot
silviuaavram Nov 17, 2026
0da4e0e
add scrub area adornment slot
silviuaavram Nov 17, 2026
4b00939
add scrubbing to owner state
silviuaavram Nov 17, 2026
d0a89f8
simplify locale prop types
silviuaavram Nov 17, 2026
342c0f1
component description
silviuaavram Nov 17, 2026
1303400
lowercase slot names
silviuaavram Nov 17, 2026
1930ad1
use base-ui 1.9.0
silviuaavram Nov 17, 2026
c539d2a
add missing docs sections
silviuaavram Nov 17, 2026
987c1b1
add group slot for the equivalent base ui component
silviuaavram Nov 17, 2026
7119aae
remove unnecessary tests and asserts
silviuaavram Nov 17, 2026
fa4352e
no more group slot, reuse input slot for that element
silviuaavram Nov 18, 2026
46a03a9
simplifications
silviuaavram Nov 18, 2026
9e8fa11
fix branding and run prettier
silviuaavram Nov 18, 2026
d69c820
proptypes
silviuaavram Nov 18, 2026
c2733c8
resolve the helperTextId with the slot props
silviuaavram Nov 18, 2026
43c0586
clean the component prop
silviuaavram Nov 18, 2026
194418b
add the rest of the class names for every slot
silviuaavram Nov 18, 2026
acf4036
reexport data attributes
silviuaavram Nov 18, 2026
a97ddfd
make slotProps.htmlInput take precedence over id
silviuaavram Nov 19, 2026
e275dd3
no need to have second render adapter over Group
silviuaavram Nov 19, 2026
d68bec5
read inputRender from the result of useSlot
silviuaavram Nov 19, 2026
6456e6d
inline start adornment boolean
silviuaavram Nov 19, 2026
c4a0fbf
consolidate keyboard handler tests
silviuaavram Nov 19, 2026
51e23bb
remove unneeded type tests
silviuaavram Nov 19, 2026
8a15e22
fix pnpm-lock
silviuaavram Nov 19, 2026
ea4bc5a
hide helper text on false
silviuaavram Nov 19, 2026
d3dfb67
fix the filled split buttons alignment
silviuaavram Nov 19, 2026
24de0bf
accept custom color, size, and simplify format
silviuaavram Nov 19, 2026
209e44e
simplify the input related props passing
silviuaavram Nov 19, 2026
3d69810
locales
silviuaavram Nov 20, 2026
15f1a0f
[NumberField] Split the ButtonBase keyboard fix into a separate PR
silviuaavram Nov 20, 2026
d995945
temporarily skip failing tests because of button base
silviuaavram Nov 20, 2026
b13ea47
mention base ui form issue in the docs
silviuaavram Nov 20, 2026
f051752
make buttons use slotProps for sizing when provided
silviuaavram Nov 20, 2026
0de560e
fix end adornment state and input.render override
silviuaavram Nov 20, 2026
3d670a3
document custom root replacement
silviuaavram Nov 20, 2026
28fa854
use FilledInput's themed root and preserve role="group"
silviuaavram Nov 20, 2026
06def3a
only render the scrub area slot when scrubAreaPosition is true
silviuaavram Nov 20, 2026
6c340a3
test improvements for slot replacement and other consolidations
silviuaavram Nov 20, 2026
0e1c5f3
remove scrubbing class overrides resolver
silviuaavram Nov 20, 2026
3a46787
adapt to the new baseui fix
silviuaavram Nov 20, 2026
fbb7a77
update pnpm lock
silviuaavram Nov 20, 2026
9c449e6
enable the base button fix related tests
silviuaavram Nov 20, 2026
d5d946b
warn about using name in slots.inputProps, also removes it
silviuaavram Nov 25, 2026
5328800
fix filled unlabelled version
silviuaavram Nov 25, 2026
ff14762
fix the height of chevrons
silviuaavram Nov 25, 2026
141afd9
fix scrub area icon alignment in filled
silviuaavram Nov 25, 2026
04389ca
add visual tests for cases missing from the docs
silviuaavram Nov 25, 2026
a355223
update the docs about the sibling inputs
silviuaavram Nov 26, 2026
b918a95
restore useButtonBase test
silviuaavram Nov 26, 2026
20a79fd
remove scrubAreaAdornment, use start and end adornments instead
silviuaavram Nov 27, 2026
a3e08d5
change anatomy to reflect a material ui component
silviuaavram Nov 30, 2026
b29e694
improve the docs to match material ui components docs
silviuaavram Nov 30, 2026
78cf5b5
fix possible type mistakes in a style rule
silviuaavram Nov 30, 2026
a3ad88d
build getRenderElementProps and reuse it
silviuaavram Nov 30, 2026
3b982d7
improve callback reason coverage
silviuaavram Nov 30, 2026
fe44cfd
fix a test for firefox
silviuaavram Nov 30, 2026
57a2665
correctly handle required
silviuaavram Dec 1, 2026
5b2247d
add margin
silviuaavram Dec 1, 2026
3df3abb
improve docs for render
silviuaavram Dec 2, 2026
02acdcd
use the id from render when provided, simplify the usage
silviuaavram Dec 2, 2026
d9460dd
docs improvement for the callback reason
silviuaavram Dec 2, 2026
3bb6dd5
fix a default size prop from form control
silviuaavram Dec 3, 2026
a6a6770
add some code comments
silviuaavram Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import * as React from 'react';
import ClearIcon from '@mui/icons-material/Clear';
import Box from '@mui/material/Box';
import IconButton from '@mui/material/IconButton';
import NumberField from '@mui/material/NumberField';

export default function NumberFieldAdornments() {
const [value, setValue] = React.useState<number | null>(5);
const inputRef = React.useRef<HTMLInputElement>(null);

return (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 3 }}>
{/* @focus-start */}
<NumberField
label="Hourly rate (USD)"
defaultValue={25}
min={0}
startAdornment="$"
endAdornment="/hr"
controlsPosition="split"
/>
<NumberField
label="Quantity"
inputRef={inputRef}
value={value}
onValueChange={setValue}
min={0}
controlsPosition="stacked"
endAdornment={
<IconButton
aria-label="Clear quantity"
size="small"
disabled={value === null}
onClick={() => {
setValue(null);
inputRef.current?.focus();
}}
>
<ClearIcon fontSize="small" />
</IconButton>
}
/>
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

const ClientProvider = createDemoClient(import.meta.url);

export default ClientProvider;
export default createDemoClient(import.meta.url);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDemo } from '@mui/internal-core-docs/utils/createDemo';
import NumberFieldAdornments from './NumberFieldAdornments';
import ClientProvider from './client';

export default createDemo(import.meta.url, NumberFieldAdornments, { ClientProvider });
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Box from '@mui/material/Box';
import NumberField from '@mui/material/NumberField';

export default function BasicNumberFields() {
return (
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
gap: 3,
'& > .MuiNumberField-root': { width: '25ch' },
}}
>
{/* @focus-start */}
<NumberField label="Outlined" defaultValue={5} />
<NumberField label="Filled" variant="filled" defaultValue={5} />
<NumberField label="Standard" variant="standard" defaultValue={5} />
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

const ClientProvider = createDemoClient(import.meta.url);

export default ClientProvider;
export default createDemoClient(import.meta.url);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDemo } from '@mui/internal-core-docs/utils/createDemo';
import BasicNumberFields from './BasicNumberFields';
import ClientProvider from './client';

export default createDemo(import.meta.url, BasicNumberFields, { ClientProvider });
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Box from '@mui/material/Box';
import NumberField from '@mui/material/NumberField';

export default function NumberFieldColors() {
return (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 3 }}>
{/* @focus-start */}
<NumberField label="Secondary" color="secondary" defaultValue={5} focused />
<NumberField label="Success" color="success" defaultValue={5} focused />
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use client';

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

export default createDemoClient(import.meta.url);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDemo } from '@mui/internal-core-docs/utils/createDemo';
import NumberFieldColors from './NumberFieldColors';
import ClientProvider from './client';

export default createDemo(import.meta.url, NumberFieldColors, { ClientProvider });
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Box from '@mui/material/Box';
import NumberField from '@mui/material/NumberField';

export default function NumberFieldConstraints() {
return (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 3 }}>
{/* @focus-start */}
<NumberField
label="Clamped to range"
defaultValue={5}
min={1}
max={10}
helperText="Type 11, then leave the field."
/>
<NumberField
label="Allow out of range"
defaultValue={5}
min={1}
max={10}
allowOutOfRange
helperText="Typed values outside 1–10 are kept."
/>
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use client';

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

export default createDemoClient(import.meta.url);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDemo } from '@mui/internal-core-docs/utils/createDemo';
import NumberFieldConstraints from './NumberFieldConstraints';
import ClientProvider from './client';

export default createDemo(import.meta.url, NumberFieldConstraints, { ClientProvider });
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Box from '@mui/material/Box';
import NumberField from '@mui/material/NumberField';

export default function NumberFieldControlPositions() {
return (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 3 }}>
{/* @focus-start */}
{(['outlined', 'filled', 'standard'] as const).map((variant) => (
<Box
key={variant}
role="group"
aria-label={variant}
sx={{
display: 'grid',
gridAutoRows: '1fr',
alignItems: 'center',
gap: 3,
width: '25ch',
maxWidth: '100%',
}}
>
<NumberField
label="End"
variant={variant}
controlsPosition="end"
defaultValue={5}
/>
<NumberField
label="Split"
variant={variant}
controlsPosition="split"
defaultValue={5}
/>
<NumberField
label="Stacked"
variant={variant}
controlsPosition="stacked"
defaultValue={5}
/>
<NumberField
label="None"
variant={variant}
controlsPosition={false}
defaultValue={5}
/>
</Box>
))}
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use client';

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

export default createDemoClient(import.meta.url);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createDemo } from '@mui/internal-core-docs/utils/createDemo';
import NumberFieldControlPositions from './NumberFieldControlPositions';
import ClientProvider from './client';

export default createDemo(import.meta.url, NumberFieldControlPositions, { ClientProvider });

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Box from '@mui/material/Box';
import NumberField from '@mui/material/NumberField';

export default function FormPropsNumberFields() {
return (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 3 }}>
{/* @focus-start */}
<NumberField
label="Required"
required
defaultValue={5}
helperText="Number of items to order."
/>
<NumberField label="Disabled" disabled defaultValue={5} />
<NumberField label="Read only" readOnly defaultValue={5} />
{/* @focus-end */}
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use client';

import { createDemoClient } from '@mui/internal-core-docs/utils/createDemoClient';

export default createDemoClient(import.meta.url);
Loading
Loading