diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js
index 83403dab50..653344f4b8 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import HorizontalRule from '@mui/icons-material/HorizontalRule';
export default function UnstyledCheckboxIndeterminate() {
@@ -30,7 +30,7 @@ const grey = {
100: '#E5EAF2',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.tsx b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.tsx
index 83403dab50..653344f4b8 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.tsx
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import HorizontalRule from '@mui/icons-material/HorizontalRule';
export default function UnstyledCheckboxIndeterminate() {
@@ -30,7 +30,7 @@ const grey = {
100: '#E5EAF2',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
index 86a1366f3a..af25dd54fe 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import HorizontalRule from '@mui/icons-material/HorizontalRule';
import Check from '@mui/icons-material/Check';
@@ -76,7 +76,7 @@ const grey = {
800: '#303740',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.tsx b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.tsx
index 86a1366f3a..af25dd54fe 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.tsx
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import HorizontalRule from '@mui/icons-material/HorizontalRule';
import Check from '@mui/icons-material/Check';
@@ -76,7 +76,7 @@ const grey = {
800: '#303740',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.js b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.js
index 9b54f4ec1e..cd38cbc76b 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.js
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.js
@@ -1,12 +1,12 @@
import * as React from 'react';
-import { Checkbox } from '@base_ui/react/Checkbox';
+import * as Checkbox from '@base_ui/react/Checkbox';
import { useTheme } from '@mui/system';
import Check from '@mui/icons-material/Check';
export default function UnstyledCheckboxIntroduction() {
return (
-
-
-
+
+
-
-
+
-
-
+
-
+
);
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.tsx b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.tsx
index 9b54f4ec1e..cd38cbc76b 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.tsx
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/css/index.tsx
@@ -1,12 +1,12 @@
import * as React from 'react';
-import { Checkbox } from '@base_ui/react/Checkbox';
+import * as Checkbox from '@base_ui/react/Checkbox';
import { useTheme } from '@mui/system';
import Check from '@mui/icons-material/Check';
export default function UnstyledCheckboxIntroduction() {
return (
-
-
-
+
+
-
-
+
-
-
+
-
+
);
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.js b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.js
index 47a4ecba04..e0e5c9c066 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.js
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.js
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import Check from '@mui/icons-material/Check';
export default function UnstyledSwitchIntroduction() {
@@ -44,7 +44,7 @@ const blue = {
800: '#004C99',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.tsx b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.tsx
index 47a4ecba04..e0e5c9c066 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.tsx
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/system/index.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
import Check from '@mui/icons-material/Check';
export default function UnstyledSwitchIntroduction() {
@@ -44,7 +44,7 @@ const blue = {
800: '#004C99',
};
-const Checkbox = styled(BaseCheckbox)(
+const Checkbox = styled(BaseCheckbox.Root)(
({ theme }) => `
width: 24px;
height: 24px;
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.js b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.js
index b1b9f7d71e..ef5cea9ea1 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.js
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.js
@@ -1,6 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { Checkbox as BaseCheckbox } from '@base_ui/react/Checkbox';
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
+
import { useTheme } from '@mui/system';
import Check from '@mui/icons-material/Check';
@@ -41,7 +42,7 @@ export default function UnstyledCheckboxIntroduction() {
const Checkbox = React.forwardRef(function Checkbox(props, ref) {
return (
-
diff --git a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx
index 26a0cb0cb8..ca8f93db4a 100644
--- a/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx
+++ b/docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
-import {
- Checkbox as BaseCheckbox,
- type CheckboxIndicatorProps,
- type CheckboxProps,
+import * as BaseCheckbox from '@base_ui/react/Checkbox';
+import type {
+ CheckboxIndicatorProps,
+ CheckboxRootProps,
} from '@base_ui/react/Checkbox';
import { useTheme } from '@mui/system';
import Check from '@mui/icons-material/Check';
@@ -42,10 +42,10 @@ export default function UnstyledCheckboxIntroduction() {
);
}
-const Checkbox = React.forwardRef(
+const Checkbox = React.forwardRef(
function Checkbox(props, ref) {
return (
-
diff --git a/docs/data/base/components/checkbox/checkbox.md b/docs/data/base/components/checkbox/checkbox.md
index 6a74ca7863..f4caf40e62 100644
--- a/docs/data/base/components/checkbox/checkbox.md
+++ b/docs/data/base/components/checkbox/checkbox.md
@@ -1,7 +1,7 @@
---
productId: base-ui
title: React Checkbox component and hook
-components: Checkbox, CheckboxIndicator
+components: CheckboxRoot, CheckboxIndicator
hooks: useCheckbox
githubLabel: 'component: checkbox'
waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
@@ -24,7 +24,7 @@ The Checkbox component provides users with a checkbox for toggling a checked sta
## Component
```jsx
-import { Checkbox } from '@base_ui/react/Checkbox';
+import * as Checkbox from '@base_ui/react/Checkbox';
```
### Anatomy
@@ -32,29 +32,29 @@ import { Checkbox } from '@base_ui/react/Checkbox';
The `Checkbox` component is composed of a root component and an indicator child component:
```tsx
-
+
-
+
```
The indicator can contain children, such as an icon:
```tsx
-
+
-
+
```
The indicator conditionally unmounts its children when the checkbox is unchecked. For CSS animations, you can use the `keepMounted` prop to transition `visibility` and `opacity` for example:
```tsx
-
+
-
+
```
### Custom structure
@@ -62,9 +62,9 @@ The indicator conditionally unmounts its children when the checkbox is unchecked
Use the `render` prop to override the rendered checkbox or indicator element with your own components:
```jsx
-}>
+}>
} />
-
+
```
To ensure behavior works as expected:
@@ -113,9 +113,9 @@ You may not need to use hooks unless you find that you're limited by the customi
Ensure the checkbox has an accessible name via a `label` element.
```jsx
-
+
-
+
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldFormat.js b/docs/data/base/components/number-field/UnstyledNumberFieldFormat.js
index b080f2b423..e7b8fcf6f6 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldFormat.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldFormat.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled, css } from '@mui/system';
export default function UnstyledNumberFieldFormat() {
@@ -49,7 +49,7 @@ const NumberLabel = styled('label')`
font-weight: bold;
`;
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldFormat.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldFormat.tsx
index b080f2b423..e7b8fcf6f6 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldFormat.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldFormat.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled, css } from '@mui/system';
export default function UnstyledNumberFieldFormat() {
@@ -49,7 +49,7 @@ const NumberLabel = styled('label')`
font-weight: bold;
`;
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.js b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.js
index 13fe4e39cf..81dca23513 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField } from '@base_ui/react/NumberField';
+import * as NumberField from '@base_ui/react/NumberField';
import { useTheme } from '@mui/system';
function useIsDarkMode() {
@@ -14,7 +14,7 @@ export default function UnstyledNumberFieldIntroduction() {
return (
-
-
+
);
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.tsx
index 13fe4e39cf..81dca23513 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/css/index.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField } from '@base_ui/react/NumberField';
+import * as NumberField from '@base_ui/react/NumberField';
import { useTheme } from '@mui/system';
function useIsDarkMode() {
@@ -14,7 +14,7 @@ export default function UnstyledNumberFieldIntroduction() {
return (
-
-
+
);
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.js b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.js
index 16b902cad3..b6f794b434 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { css, styled, useTheme } from '@mui/system';
function useIsDarkMode() {
@@ -71,7 +71,7 @@ const grey = {
900: '#1C2025',
};
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.tsx
index 16b902cad3..b6f794b434 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/system/index.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { css, styled, useTheme } from '@mui/system';
function useIsDarkMode() {
@@ -71,7 +71,7 @@ const grey = {
900: '#1C2025',
};
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.js b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.js
index 703361616f..5a4e44a292 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.js
@@ -1,6 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
+
import { useTheme } from '@mui/system';
function classNames(...classes) {
@@ -58,7 +59,7 @@ export default function NumberFieldIntroduction() {
}
const NumberField = React.forwardRef(function NumberField(props, ref) {
- return ;
+ return ;
});
const NumberFieldGroup = React.forwardRef(function NumberFieldGroup(props, ref) {
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.tsx
index da82eab7a4..d3751d9cba 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldIntroduction/tailwind/index.tsx
@@ -1,11 +1,11 @@
import * as React from 'react';
-import {
- NumberField as BaseNumberField,
- NumberFieldDecrementProps,
+import * as BaseNumberField from '@base_ui/react/NumberField';
+import type {
+ NumberFieldRootProps,
NumberFieldGroupProps,
+ NumberFieldDecrementProps,
NumberFieldIncrementProps,
NumberFieldInputProps,
- NumberFieldProps,
NumberFieldScrubAreaProps,
} from '@base_ui/react/NumberField';
import { useTheme } from '@mui/system';
@@ -65,10 +65,10 @@ export default function NumberFieldIntroduction() {
}
const NumberField = React.forwardRef(function NumberField(
- props: NumberFieldProps,
+ props: NumberFieldRootProps,
ref: React.ForwardedRef,
) {
- return ;
+ return ;
});
const NumberFieldGroup = React.forwardRef(function NumberFieldGroup(
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldScrub.js b/docs/data/base/components/number-field/UnstyledNumberFieldScrub.js
index 837070714c..9b63ccb09c 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldScrub.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldScrub.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled } from '@mui/system';
export default function UnstyledNumberFieldScrub() {
@@ -40,7 +40,7 @@ const grey = {
900: '#1C2025',
};
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldScrub.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldScrub.tsx
index 837070714c..9b63ccb09c 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldScrub.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldScrub.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled } from '@mui/system';
export default function UnstyledNumberFieldScrub() {
@@ -40,7 +40,7 @@ const grey = {
900: '#1C2025',
};
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.js b/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.js
index 7d5edc13eb..1d75392517 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.js
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled } from '@mui/system';
export default function UnstyledNumberFieldWheelScrub() {
@@ -42,7 +42,7 @@ const NumberLabel = styled('label')`
font-weight: bold;
`;
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.tsx b/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.tsx
index 7d5edc13eb..1d75392517 100644
--- a/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.tsx
+++ b/docs/data/base/components/number-field/UnstyledNumberFieldWheelScrub.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { NumberField as BaseNumberField } from '@base_ui/react/NumberField';
+import * as BaseNumberField from '@base_ui/react/NumberField';
import { styled } from '@mui/system';
export default function UnstyledNumberFieldWheelScrub() {
@@ -42,7 +42,7 @@ const NumberLabel = styled('label')`
font-weight: bold;
`;
-const NumberField = styled(BaseNumberField)`
+const NumberField = styled(BaseNumberField.Root)`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 1rem;
`;
diff --git a/docs/data/base/components/number-field/number-field.md b/docs/data/base/components/number-field/number-field.md
index 65b2159d8c..244cfaf36d 100644
--- a/docs/data/base/components/number-field/number-field.md
+++ b/docs/data/base/components/number-field/number-field.md
@@ -2,7 +2,7 @@
productId: base-ui
title: React NumberField component and hook
githubLabel: 'component: number-field'
-components: NumberField, NumberFieldGroup, NumberFieldInput, NumberFieldIncrement, NumberFieldDecrement, NumberFieldScrubArea, NumberFieldScrubAreaCursor
+components: NumberFieldRoot, NumberFieldGroup, NumberFieldInput, NumberFieldIncrement, NumberFieldDecrement, NumberFieldScrubArea, NumberFieldScrubAreaCursor
hooks: useNumberField
waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/
---
@@ -24,7 +24,7 @@ A number field is a UI element that accepts numeric values from the user. `Numbe
## Component
```jsx
-import { NumberField } from '@base_ui/react/NumberField';
+import * as NumberField from '@base_ui/react/NumberField';
```
### Anatomy
@@ -32,7 +32,7 @@ import { NumberField } from '@base_ui/react/NumberField';
The `NumberField` component is composed of a root component and a group component which contains an input, and optionally, an increment button, decrement button, and a scrub area with a virtual cursor:
```tsx
-
+
@@ -41,7 +41,7 @@ The `NumberField` component is composed of a root component and a group componen
-
+
```
### Custom structure
@@ -49,9 +49,9 @@ The `NumberField` component is composed of a root component and a group componen
Use the `render` prop to override the rendered elements with your own components:
```jsx
-}>
+}>
{/* Subcomponents */}
-
+
```
All subcomponents accept the `render` prop.
@@ -77,13 +77,13 @@ The `value` prop holds the number value, and `onChange` is called when it update
function App() {
const [value, setValue] = useState(0);
return (
-
+ −+
-
+
);
}
```
@@ -95,13 +95,13 @@ This is the controlled way of handling the number field.
When the number field is uncontrolled, the `defaultValue` prop sets the initial value of the input:
```jsx
-
+−+
-
+
```
### Min and max values
@@ -109,13 +109,13 @@ When the number field is uncontrolled, the `defaultValue` prop sets the initial
To prevent the value from going below or above a certain amount, the `min` and `max` props can be used:
```jsx
-
+−+
-
+
```
### Step
@@ -123,13 +123,13 @@ To prevent the value from going below or above a certain amount, the `min` and `
The `step` prop snaps values of the input to ones that are multiples of the given number, affecting how the stepper buttons change the value:
```jsx
-
+−+
-
+
```
In the above example, the numbers are snapped to multiples of `step` starting from the `min` value: `2`, `7`, `12`, `17` and so on.
@@ -140,13 +140,13 @@ The `largeStep` and `smallStep` props can be specified to change the step when a
- `smallStep` is used when alt is held, incrementing and snapping to multiples of `0.1`.
```jsx
-
+−+
-
+
```
### Format
diff --git a/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.js b/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.js
index b5e052a2bf..6f067c8253 100644
--- a/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.js
+++ b/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.js
@@ -1,38 +1,38 @@
import * as React from 'react';
-import { Switch } from '@base_ui/react/Switch';
+import * as Switch from '@base_ui/react/Switch';
import { useTheme } from '@mui/system';
export default function UnstyledSwitchIntroduction() {
return (
-
-
-
+
-
-
+
-
-
+
-
+
);
diff --git a/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.tsx b/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.tsx
index b5e052a2bf..6f067c8253 100644
--- a/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.tsx
+++ b/docs/data/base/components/switch/UnstyledSwitchIntroduction/css/index.tsx
@@ -1,38 +1,38 @@
import * as React from 'react';
-import { Switch } from '@base_ui/react/Switch';
+import * as Switch from '@base_ui/react/Switch';
import { useTheme } from '@mui/system';
export default function UnstyledSwitchIntroduction() {
return (