An autocomplete component is a text input enhanced by a panel of suggested options.
+
+{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
+
+{{"component": "modules/components/ComponentPageTabs.js"}}
+
+## Introduction
+
+An autocomplete component is an enhanced text input that shows a list of suggested options as users type, and lets them select an option from the list.
+
+Base UI provides the `useAutocomplete` hook for building a custom Autocomplete.
+It implements the WAI-ARIA Combobox pattern, and is typically used to assist users in completing form inputs or search queries faster.
+
+{{"demo": "AutocompleteIntroduction", "defaultCodeOpen": false, "bg": "gradient"}}
+
+:::warning
+Material UI and Joy UI have Autocomplete components that are built using the `useAutocomplete` hook, and they include many features not yet described here.
+
+To learn more about implementing a custom Autocomplete, you can explore the [`useAutocomplete` API docs](/base-ui/react-autocomplete/hooks-api/#use-autocomplete), or reference the Material UI and Joy UI implementations:
+
+- [Material UI Autocomplete](/material-ui/react-autocomplete/)
+- [Joy UI Autocomplete](/joy-ui/react-autocomplete/)
+
+:::
+
+## Hook
+
+```jsx
+import { useAutocomplete } from '@mui/base/useAutocomplete';
+```
+
+The `useAutocomplete` hook requires a list of `options` to be displayed when the textbox receives focus.
+The value must be chosen from a predefined set of values.
+
+The following demo shows how to create a simple combobox, apply styles, and write the selected value to a state variable using the `onChange` prop:
+
+{{"demo": "UseAutocomplete.js"}}
+
+## Customization
+
+### Rendering options
+
+By default, the `options` prop accepts an array of `string`s or `{ label: string }`:
+
+```js
+const options = [
+ { label: 'The Godfather', id: 1 },
+ { label: 'Pulp Fiction', id: 2 },
+];
+// or
+const options = ['The Godfather', 'Pulp Fiction'];
+```
+
+If you need to use a different structure for options, you must provide a function to the `getOptionLabel` prop that resolves each option to a unique value.
+
+```js
+const options = [
+ { issuer: 'Bank of America', brand: 'Visa', last4: '1234' },
+ { issuer: 'Bank of America', brand: 'MasterCard', last4: '5678' },
+ { issuer: 'Barclays', brand: 'Visa', last4: '4698' },
+ // ...
+];
+
+const {
+ getRootProps,
+ // etc
+} = useAutocomplete({
+ getOptionLabel: (option) => option.last4,
+});
+```
+
+### Controlled states
+
+The `useAutocomplete` hook has two states that can be controlled:
+
+1. the "value" state with the `value`/`onChange` props combination. This state represents the value selected by the user, for instance when pressing Enter.
+2. the "input value" state with the `inputValue`/`onInputChange` props combination. This state represents the value displayed in the textbox.
+
+These two states are isolated, and should be controlled independently.
+
+:::info
+
+- A component is **controlled** when it's managed by its parent using props.
+- A component is **uncontrolled** when it's managed by its own local state.
+
+Learn more about controlled and uncontrolled components in the [React documentation](https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components).
+:::
+
+{{"demo": "ControlledStates.js"}}
+
+### Using a portal
+
+React Portals can be used to render the listbox outside of the DOM hierarchy, making it easier to allow it to "float" above adjacent elements.
+
+Base UI provides a [Popper](/base-ui/react-popper/) component built around React's `createPortal()` for exactly this purpose, and additionally helps you manage keyboard focus as it moves in and out of the portal.
+
+To render the listbox in Base UI's Popper, the `ref`s must be merged as follows:
+
+```jsx
+import { useAutocomplete } from '@mui/base/useAutocomplete';
+import { Popper } from '@mui/base/Popper';
+import { unstable_useForkRef as useForkRef } from '@mui/utils';
+
+export default function App(props) {
+ const {
+ getRootProps,
+ getInputProps,
+ getListboxProps,
+ getOptionProps,
+ popupOpen,
+ anchorEl,
+ setAnchorEl,
+ groupedOptions,
+ } = useAutocomplete(props);
+
+ const rootRef = useForkRef(ref, setAnchorEl);
+
+ return (
+
+
+ );
+}
+
+const resolveSlotProps = (fn: any, args: any) =>
+ typeof fn === 'function' ? fn(args) : fn;
+
+const Badge = React.forwardRef((props, ref) => {
+ return (
+ {
+ const resolvedSlotProps = resolveSlotProps(
+ props.slotProps?.root,
+ ownerState,
+ );
+ return {
+ ...resolvedSlotProps,
+ className: clsx(
+ 'box-border m-0 p-0 text-xs list-none relative inline-block leading-none',
+ resolvedSlotProps?.className,
+ ),
+ };
+ },
+ badge: (ownerState) => {
+ const resolvedSlotProps = resolveSlotProps(
+ props.slotProps?.badge,
+ ownerState,
+ );
+ return {
+ ...resolvedSlotProps,
+ className: clsx(
+ 'z-auto absolute top-0 right-0 min-w-badge min-h-badge font-sans p-0 text-white font-semibold font-xs font-sans rounded-xl bg-purple-500 leading-5.5 whitespace-nowrap text-center translate-x-1/2 -translate-y-1/2 drop-shadow-lg origin-right',
+ resolvedSlotProps?.className,
+ ),
+ };
+ },
+ }}
+ />
+ );
+});
diff --git a/docs/data/base/components/badge/UnstyledBadgeIntroduction/tailwind/index.tsx.preview b/docs/data/base/components/badge/UnstyledBadgeIntroduction/tailwind/index.tsx.preview
new file mode 100644
index 00000000000000..bd190ede6b357d
--- /dev/null
+++ b/docs/data/base/components/badge/UnstyledBadgeIntroduction/tailwind/index.tsx.preview
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/badge/badge-pt.md b/docs/data/base/components/badge/badge-pt.md
index af79492369dc0e..2a5969087d0b53 100644
--- a/docs/data/base/components/badge/badge-pt.md
+++ b/docs/data/base/components/badge/badge-pt.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Unstyled React Badge component and hook
components: BadgeUnstyled
githubLabel: 'component: badge'
@@ -21,7 +21,7 @@ The `BadgeUnstyled` component creates a badge that is applied to its child eleme
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
@@ -57,7 +57,7 @@ The `BadgeUnstyled` component is composed of a root `` that houses the ele
### Slot props
:::info
-The following props are available on all non-utility Base components. See [Usage](/base/getting-started/usage/) for full details.
+The following props are available on all non-utility Base components. See [Usage](/base-ui/getting-started/usage/) for full details.
:::
Use the `component` prop to override the root slot with a custom element:
diff --git a/docs/data/base/components/badge/badge-zh.md b/docs/data/base/components/badge/badge-zh.md
index 79607246503b3f..64abd2fb25837a 100644
--- a/docs/data/base/components/badge/badge-zh.md
+++ b/docs/data/base/components/badge/badge-zh.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Unstyled React Badge component and hook
components: BadgeUnstyled
githubLabel: 'component: badge'
@@ -21,7 +21,7 @@ The `BadgeUnstyled` component creates a badge that is applied to its child eleme
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
@@ -57,7 +57,7 @@ The `BadgeUnstyled` component is composed of a root `` that houses the ele
### Slot props
:::info
-The following props are available on all non-utility Base components. See [Usage](/base/getting-started/usage/) for full details.
+The following props are available on all non-utility Base components. See [Usage](/base-ui/getting-started/usage/) for full details.
:::
Use the `component` prop to override the root slot with a custom element:
diff --git a/docs/data/base/components/badge/badge.md b/docs/data/base/components/badge/badge.md
index 86d50f69308bab..71f557d58fd79c 100644
--- a/docs/data/base/components/badge/badge.md
+++ b/docs/data/base/components/badge/badge.md
@@ -1,55 +1,39 @@
---
-product: base
-title: Unstyled React Badge component and hook
-components: BadgeUnstyled
+productId: base-ui
+title: React Badge component and hook
+components: Badge
+hooks: useBadge
githubLabel: 'component: badge'
---
-# Unstyled badge
+# Badge
-
The BadgeUnstyled component generates a small label that is attached to its child element.
+
The Badge component generates a small label that is attached to its child element.
+
+{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
+
+{{"component": "modules/components/ComponentPageTabs.js"}}
## Introduction
A badge is a small descriptor for UI elements.
It typically sits on or near an element and indicates the status of that element by displaying a number, icon, or other short set of characters.
-The `BadgeUnstyled` component creates a badge that is applied to its child element.
+The Badge component creates a badge that is applied to its child element.
-{{"demo": "UnstyledBadgeIntroduction.tsx", "defaultCodeOpen": false, "bg": "gradient"}}
-
-{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
+{{"demo": "UnstyledBadgeIntroduction", "defaultCodeOpen": false, "bg": "gradient"}}
## Component
-### Usage
-
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
-
```jsx
-import BadgeUnstyled from '@mui/base/BadgeUnstyled';
-
-export default function MyApp() {
- return (
- {/* the element that the badge is attached to */}
- );
-}
+import { Badge } from '@mui/base/Badge';
```
-### Basics
-
-`BadgeUnstyled` wraps around the UI element that it's attached to.
-For instance, if the badge indicates the number of emails in an inbox, then the component will be structured like this:
-
-```jsx
-
-
-
-```
+The Badge wraps around the UI element that it's attached to.
### Anatomy
-The `BadgeUnstyled` component is composed of a root `` that houses the element that the badge is attached to, followed by a `` slot to represent the badge itself:
+The Badge component is composed of a root `` that houses the element that the Badge is attached to, followed by a `` slot to represent the Badge itself:
```html
@@ -58,46 +42,51 @@ The `BadgeUnstyled` component is composed of a root `` that houses the ele
```
-### Slot props
+### Custom structure
+
+Use the `slots` prop to override the root or any other interior slot:
+
+```jsx
+
+```
:::info
-The following props are available on all non-utility Base components.
-See [Usage](/base/getting-started/usage/) for full details.
+The `slots` prop is available on all non-utility Base components.
+See [Overriding component structure](/base-ui/guides/overriding-component-structure/) for full details.
:::
-Use the `component` prop to override the root slot with a custom element:
+Use the `slotProps` prop to pass custom props to internal slots.
+The following code snippet applies a CSS class called `my-badge` to the badge slot:
```jsx
-
+
```
-Use the `slots` prop to override any interior slots in addition to the root:
+### Usage with TypeScript
-```jsx
-
-```
+In TypeScript, you can specify the custom component type used in the `slots.root` as a generic parameter of the unstyled component.
+This way, you can safely provide the custom root's props directly on the component:
-:::warning
-If the root element is customized with both the `component` and `slots` props, then `component` will take precedence.
-:::
+```tsx
+ slots={{ root: CustomComponent }} customProp />
+```
-Use the `slotProps` prop to pass custom props to internal slots.
-The following code snippet applies a CSS class called `my-badge` to the badge slot:
+The same applies for props specific to custom primitive elements:
-```jsx
-
+```tsx
+ slots={{ root: 'img' }} src="badge.png" />
```
## Hook
```jsx
-import { useBadge } from '@mui/base/BadgeUnstyled';
+import { useBadge } from '@mui/base/useBadge';
```
-The `useBadge` hook lets you apply the functionality of `BadgeUnstyled` to a fully custom component.
+The `useBadge` hook lets you apply the functionality of a Badge to a fully custom component.
It returns props to be placed on the custom component, along with fields representing the component's internal state.
-Hooks _do not_ support [slot props](#slot-props), but they do support [customization props](#customization).
+Hooks _do not_ support [slot props](#custom-structure), but they do support [customization props](#customization).
:::info
Hooks give you the most room for customization, but require more work to implement.
@@ -115,27 +104,27 @@ For the sake of simplicity, demos and code snippets primarily feature components
### Badge content
-The `badgeContent` prop defines the content that's displayed inside the badge.
-When this content is a number, there are additional props you can use for further customization—see the [Numerical badges section](#numerical-badges) below.
+The `badgeContent` prop defines the content that's displayed inside the Badge.
+When this content is a number, there are additional props you can use for further customization—see the [Numerical Badges section](#numerical-badges) below.
-The following demo shows how to create and style a typical numerical badge that's attached to a generic box element:
+The following demo shows how to create and style a typical numerical Badge that's attached to a generic box element:
-{{"demo": "UnstyledBadge.js", "defaultCodeOpen": false}}
+{{"demo": "UnstyledBadge", "defaultCodeOpen": false}}
### Badge visibility
-You can control the visibility of a badge by using the `invisible` prop.
-Setting a badge to `invisible` does not actually hide it—instead, this prop adds the `BaseBadge-invisible` class to the badge, which you can target with styles to hide however you prefer:
+You can control the visibility of a Badge by using the `invisible` prop.
+Setting a Badge to `invisible` does not actually hide it—instead, this prop adds the `BaseBadge-invisible` class to the Badge, which you can target with styles to hide however you prefer:
{{"demo": "BadgeVisibility.js"}}
-### Numerical badges
+### Numerical Badges
The following props are useful when `badgeContent` is a number.
#### The showZero prop
-By default, badges automatically hide when `badgeContent={0}`.
+By default, Badges automatically hide when `badgeContent={0}`.
You can override this behavior with the `showZero` prop:
{{"demo": "ShowZeroBadge.js"}}
@@ -149,7 +138,7 @@ The default is 99.
## Accessibility
-Screen readers may not provide users with enough information about a badge's contents.
+Screen readers may not provide users with enough information about a Badge's contents.
To make your badge accessible, you must provide a full description with `aria-label`, as shown in the demo below:
{{"demo": "AccessibleBadges.js"}}
diff --git a/docs/data/base/components/button/UnstyledButtonCustom.js b/docs/data/base/components/button/UnstyledButtonCustom.js
index 3044a6a7a3893a..4f4e2399fafeaf 100644
--- a/docs/data/base/components/button/UnstyledButtonCustom.js
+++ b/docs/data/base/components/button/UnstyledButtonCustom.js
@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses } from '@mui/base/Button';
import { styled } from '@mui/system';
const ButtonRoot = React.forwardRef(function ButtonRoot(props, ref) {
@@ -21,6 +21,14 @@ ButtonRoot.propTypes = {
children: PropTypes.node,
};
+const SvgButton = React.forwardRef(function SvgButton(props, ref) {
+ return ;
+});
+
+export default function UnstyledButtonCustom() {
+ return Button;
+}
+
const blue = {
50: '#F0F7FF',
100: '#C2E0FF',
@@ -45,7 +53,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
transition: all 800ms ease;
pointer-events: none;
}
-
+
& .bg {
stroke: var(--main-color);
stroke-width: 1;
@@ -62,7 +70,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
&:hover,
- &.${buttonUnstyledClasses.focusVisible} {
+ &.${buttonClasses.focusVisible} {
.borderEffect {
stroke-dashoffset: -600;
}
@@ -73,12 +81,12 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
&:focus,
- &.${buttonUnstyledClasses.focusVisible} {
+ &.${buttonClasses.focusVisible} {
outline: 2px solid ${theme.palette.mode === 'dark' ? blue[400] : blue[200]};
outline-offset: 2px;
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
& .bg {
fill: var(--active-color);
transition: fill 300ms ease-out;
@@ -91,7 +99,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
& .content {
font-size: 0.875rem;
font-family: IBM Plex Sans, sans-serif;
- font-weight: 500;
+ font-weight: 600;
line-height: 1.5;
height: 100%;
display: flex;
@@ -106,11 +114,3 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
}`,
);
-
-const SvgButton = React.forwardRef(function SvgButton(props, ref) {
- return ;
-});
-
-export default function UnstyledButtonCustom() {
- return Button;
-}
diff --git a/docs/data/base/components/button/UnstyledButtonCustom.tsx b/docs/data/base/components/button/UnstyledButtonCustom.tsx
index de5113dd3bc9f7..72413739662779 100644
--- a/docs/data/base/components/button/UnstyledButtonCustom.tsx
+++ b/docs/data/base/components/button/UnstyledButtonCustom.tsx
@@ -1,8 +1,5 @@
import * as React from 'react';
-import ButtonUnstyled, {
- ButtonUnstyledProps,
- buttonUnstyledClasses,
-} from '@mui/base/ButtonUnstyled';
+import { Button, ButtonProps, buttonClasses } from '@mui/base/Button';
import { styled, Theme } from '@mui/system';
const ButtonRoot = React.forwardRef(function ButtonRoot(
@@ -22,6 +19,17 @@ const ButtonRoot = React.forwardRef(function ButtonRoot(
);
});
+const SvgButton = React.forwardRef(function SvgButton(
+ props: ButtonProps,
+ ref: React.ForwardedRef,
+) {
+ return ;
+});
+
+export default function UnstyledButtonCustom() {
+ return Button;
+}
+
const blue = {
50: '#F0F7FF',
100: '#C2E0FF',
@@ -46,7 +54,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
transition: all 800ms ease;
pointer-events: none;
}
-
+
& .bg {
stroke: var(--main-color);
stroke-width: 1;
@@ -63,7 +71,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
&:hover,
- &.${buttonUnstyledClasses.focusVisible} {
+ &.${buttonClasses.focusVisible} {
.borderEffect {
stroke-dashoffset: -600;
}
@@ -74,12 +82,12 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
&:focus,
- &.${buttonUnstyledClasses.focusVisible} {
+ &.${buttonClasses.focusVisible} {
outline: 2px solid ${theme.palette.mode === 'dark' ? blue[400] : blue[200]};
outline-offset: 2px;
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
& .bg {
fill: var(--active-color);
transition: fill 300ms ease-out;
@@ -92,7 +100,7 @@ const CustomButtonRoot = styled(ButtonRoot)(
& .content {
font-size: 0.875rem;
font-family: IBM Plex Sans, sans-serif;
- font-weight: 500;
+ font-weight: 600;
line-height: 1.5;
height: 100%;
display: flex;
@@ -107,14 +115,3 @@ const CustomButtonRoot = styled(ButtonRoot)(
}
}`,
);
-
-const SvgButton = React.forwardRef(function SvgButton(
- props: ButtonUnstyledProps,
- ref: React.ForwardedRef,
-) {
- return ;
-});
-
-export default function UnstyledButtonCustom() {
- return Button;
-}
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction.js b/docs/data/base/components/button/UnstyledButtonIntroduction.js
deleted file mode 100644
index 6b8618f161754a..00000000000000
--- a/docs/data/base/components/button/UnstyledButtonIntroduction.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
-import { styled } from '@mui/system';
-import Stack from '@mui/material/Stack';
-
-const blue = {
- 500: '#007FFF',
- 600: '#0072E5',
- 700: '#0059B2',
-};
-
-const grey = {
- 100: '#eaeef2',
- 300: '#afb8c1',
- 900: '#24292f',
-};
-
-const CustomButton = styled(ButtonUnstyled)(
- ({ theme }) => `
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
- font-size: 0.875rem;
- background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
- color: white;
- transition: all 150ms ease;
- cursor: pointer;
- border: none;
- box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
-
- &:hover {
- background-color: ${blue[600]};
- }
-
- &.${buttonUnstyledClasses.active} {
- background-color: ${blue[700]};
- }
-
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
- outline: none;
- }
-
- &.${buttonUnstyledClasses.disabled} {
- opacity: 0.5;
- cursor: not-allowed;
- }
- `,
-);
-
-export default function UnstyledButtonIntroduction() {
- return (
-
- Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction.tsx
deleted file mode 100644
index 6b8618f161754a..00000000000000
--- a/docs/data/base/components/button/UnstyledButtonIntroduction.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
-import { styled } from '@mui/system';
-import Stack from '@mui/material/Stack';
-
-const blue = {
- 500: '#007FFF',
- 600: '#0072E5',
- 700: '#0059B2',
-};
-
-const grey = {
- 100: '#eaeef2',
- 300: '#afb8c1',
- 900: '#24292f',
-};
-
-const CustomButton = styled(ButtonUnstyled)(
- ({ theme }) => `
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
- font-size: 0.875rem;
- background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
- color: white;
- transition: all 150ms ease;
- cursor: pointer;
- border: none;
- box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
-
- &:hover {
- background-color: ${blue[600]};
- }
-
- &.${buttonUnstyledClasses.active} {
- background-color: ${blue[700]};
- }
-
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
- outline: none;
- }
-
- &.${buttonUnstyledClasses.disabled} {
- opacity: 0.5;
- cursor: not-allowed;
- }
- `,
-);
-
-export default function UnstyledButtonIntroduction() {
- return (
-
- Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js
new file mode 100644
index 00000000000000..3dae77721c653b
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js
@@ -0,0 +1,59 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx
new file mode 100644
index 00000000000000..3dae77721c653b
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx
@@ -0,0 +1,59 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx.preview
new file mode 100644
index 00000000000000..2d592aac5304f0
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx.preview
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js
new file mode 100644
index 00000000000000..49175792bc2e54
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js
@@ -0,0 +1,60 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const grey = {
+ 100: '#eaeef2',
+ 300: '#afb8c1',
+ 900: '#24292f',
+};
+
+const CustomButton = styled(Button)(
+ ({ theme }) => `
+ font-family: IBM Plex Sans, sans-serif;
+ font-weight: 600;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ padding: 8px 16px;
+ border-radius: 8px;
+ color: white;
+ transition: all 150ms ease;
+ cursor: pointer;
+ border: none;
+ box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+ `,
+);
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx
new file mode 100644
index 00000000000000..49175792bc2e54
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx
@@ -0,0 +1,60 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const grey = {
+ 100: '#eaeef2',
+ 300: '#afb8c1',
+ 900: '#24292f',
+};
+
+const CustomButton = styled(Button)(
+ ({ theme }) => `
+ font-family: IBM Plex Sans, sans-serif;
+ font-weight: 600;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ padding: 8px 16px;
+ border-radius: 8px;
+ color: white;
+ transition: all 150ms ease;
+ cursor: pointer;
+ border: none;
+ box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+ `,
+);
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction.tsx.preview b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx.preview
similarity index 100%
rename from docs/data/base/components/button/UnstyledButtonIntroduction.tsx.preview
rename to docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx.preview
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js
new file mode 100644
index 00000000000000..3afdd444109f23
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js
@@ -0,0 +1,32 @@
+import * as React from 'react';
+import PropTypes from 'prop-types';
+import { Button } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const CustomButton = React.forwardRef((props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+});
+
+CustomButton.propTypes = {
+ className: PropTypes.string,
+};
diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx
new file mode 100644
index 00000000000000..7bc50e32c49739
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx
@@ -0,0 +1,29 @@
+import * as React from 'react';
+import { Button, ButtonProps } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsIntroduction() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const CustomButton = React.forwardRef(
+ (props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+ },
+);
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple.tsx.preview b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview
similarity index 100%
rename from docs/data/base/components/button/UnstyledButtonsSimple.tsx.preview
rename to docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview
diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js
index b665999783a0a7..81c3db1e383492 100644
--- a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js
+++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js
@@ -1,52 +1,53 @@
import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+export default function UnstyledButtonsDisabledFocus() {
+ return (
+
+ focusableWhenDisabled = false
+
+ focusableWhenDisabled = true
+
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;
-
-export default function UnstyledButtonsDisabledFocus() {
- return (
-
- focusableWhenDisabled = false
-
- focusableWhenDisabled = true
-
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx
index b665999783a0a7..81c3db1e383492 100644
--- a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx
+++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx
@@ -1,52 +1,53 @@
import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+export default function UnstyledButtonsDisabledFocus() {
+ return (
+
+ focusableWhenDisabled = false
+
+ focusableWhenDisabled = true
+
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;
-
-export default function UnstyledButtonsDisabledFocus() {
- return (
-
- focusableWhenDisabled = false
-
- focusableWhenDisabled = true
-
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js
index d971c0f9772359..29eb4906c0d8a1 100644
--- a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js
+++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js
@@ -1,54 +1,55 @@
import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+export default function UnstyledButtonsDisabledFocusCustom() {
+ return (
+
+
+ focusableWhenDisabled = false
+
+
+ focusableWhenDisabled = true
+
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
- &:hover:not(.${buttonUnstyledClasses.disabled}) {
+ &:hover:not(.${buttonClasses.disabled}) {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;
-
-export default function UnstyledButtonsDisabledFocusCustom() {
- return (
-
-
- focusableWhenDisabled = false
-
-
- focusableWhenDisabled = true
-
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx
index e29ae166ce7d13..d1e1b7eff13a85 100644
--- a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx
+++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx
@@ -1,11 +1,21 @@
import * as React from 'react';
-import ButtonUnstyled, {
- buttonUnstyledClasses,
- ButtonUnstyledTypeMap,
-} from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses, ButtonTypeMap } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '@mui/base/utils';
+
+export default function UnstyledButtonsDisabledFocusCustom() {
+ return (
+
+
+ focusableWhenDisabled = false
+
+
+ focusableWhenDisabled = true
+
+
+ );
+}
const blue = {
500: '#007FFF',
@@ -13,46 +23,34 @@ const blue = {
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
- &:hover:not(.${buttonUnstyledClasses.disabled}) {
+ &:hover:not(.${buttonClasses.disabled}) {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
-` as OverridableComponent;
-
-export default function UnstyledButtonsDisabledFocusCustom() {
- return (
-
-
- focusableWhenDisabled = false
-
-
- focusableWhenDisabled = true
-
-
- );
-}
+` as PolymorphicComponent;
diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx.preview b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx.preview
index 6c68795155388b..ea5b0163da93f7 100644
--- a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx.preview
+++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx.preview
@@ -1,6 +1,6 @@
-
+
focusableWhenDisabled = false
-
+
focusableWhenDisabled = true
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple.js b/docs/data/base/components/button/UnstyledButtonsSimple.js
deleted file mode 100644
index 3111f7ac85b435..00000000000000
--- a/docs/data/base/components/button/UnstyledButtonsSimple.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
-import { styled } from '@mui/system';
-import Stack from '@mui/material/Stack';
-
-const blue = {
- 500: '#007FFF',
- 600: '#0072E5',
- 700: '#0059B2',
-};
-
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
- font-size: 0.875rem;
- background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
- color: white;
- transition: all 150ms ease;
- cursor: pointer;
- border: none;
-
- &:hover {
- background-color: ${blue[600]};
- }
-
- &.${buttonUnstyledClasses.active} {
- background-color: ${blue[700]};
- }
-
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
- outline: none;
- }
-
- &.${buttonUnstyledClasses.disabled} {
- opacity: 0.5;
- cursor: not-allowed;
- }
-`;
-
-export default function UnstyledButtonsSimple() {
- return (
-
- Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple.tsx b/docs/data/base/components/button/UnstyledButtonsSimple.tsx
deleted file mode 100644
index 3111f7ac85b435..00000000000000
--- a/docs/data/base/components/button/UnstyledButtonsSimple.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
-import { styled } from '@mui/system';
-import Stack from '@mui/material/Stack';
-
-const blue = {
- 500: '#007FFF',
- 600: '#0072E5',
- 700: '#0059B2',
-};
-
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
- font-size: 0.875rem;
- background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
- color: white;
- transition: all 150ms ease;
- cursor: pointer;
- border: none;
-
- &:hover {
- background-color: ${blue[600]};
- }
-
- &.${buttonUnstyledClasses.active} {
- background-color: ${blue[700]};
- }
-
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
- outline: none;
- }
-
- &.${buttonUnstyledClasses.disabled} {
- opacity: 0.5;
- cursor: not-allowed;
- }
-`;
-
-export default function UnstyledButtonsSimple() {
- return (
-
- Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js
new file mode 100644
index 00000000000000..f7cdde1f0fd0be
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js
@@ -0,0 +1,65 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx
new file mode 100644
index 00000000000000..f7cdde1f0fd0be
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx
@@ -0,0 +1,65 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx.preview
new file mode 100644
index 00000000000000..2d592aac5304f0
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx.preview
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js
new file mode 100644
index 00000000000000..69d470d99c3198
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js
@@ -0,0 +1,51 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ color: white;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
+ cursor: pointer;
+ transition: all 150ms ease;
+ border: none;
+
+ &:hover:not(:disabled) {
+ background-color: ${blue[600]};
+ }
+
+ &:active:not(:disabled) {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+`;
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx
new file mode 100644
index 00000000000000..69d470d99c3198
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx
@@ -0,0 +1,51 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+ Button
+ Disabled
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ color: white;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
+ cursor: pointer;
+ transition: all 150ms ease;
+ border: none;
+
+ &:hover:not(:disabled) {
+ background-color: ${blue[600]};
+ }
+
+ &:active:not(:disabled) {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+`;
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx.preview
new file mode 100644
index 00000000000000..702ae5216245c1
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx.preview
@@ -0,0 +1,2 @@
+Button
+Disabled
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js
new file mode 100644
index 00000000000000..917ebda0a7b6f9
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js
@@ -0,0 +1,34 @@
+import * as React from 'react';
+import PropTypes from 'prop-types';
+import { Button } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+ Button
+
+ Disabled
+
+ );
+}
+
+const CustomButton = React.forwardRef((props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+});
+
+CustomButton.propTypes = {
+ className: PropTypes.string,
+};
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx
new file mode 100644
index 00000000000000..15f3ee6511736b
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx
@@ -0,0 +1,31 @@
+import * as React from 'react';
+import { Button, ButtonProps } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+ Button
+
+ Disabled
+
+ );
+}
+
+const CustomButton = React.forwardRef(
+ (props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+ },
+);
diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview
new file mode 100644
index 00000000000000..87d6569283c61f
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview
@@ -0,0 +1,4 @@
+
+ Button
+
+Disabled
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan.js b/docs/data/base/components/button/UnstyledButtonsSpan.js
index 1528e97a1e419d..45dd963617f567 100644
--- a/docs/data/base/components/button/UnstyledButtonsSpan.js
+++ b/docs/data/base/components/button/UnstyledButtonsSpan.js
@@ -1,52 +1,53 @@
import * as React from 'react';
-import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+export default function UnstyledButtonsSpan() {
+ return (
+
+ Button
+
+ Disabled
+
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;
-
-export default function UnstyledButtonsSpan() {
- return (
-
- Button
-
- Disabled
-
-
- );
-}
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan.tsx b/docs/data/base/components/button/UnstyledButtonsSpan.tsx
index f05620d89899cb..28456f29f69b20 100644
--- a/docs/data/base/components/button/UnstyledButtonsSpan.tsx
+++ b/docs/data/base/components/button/UnstyledButtonsSpan.tsx
@@ -1,11 +1,19 @@
import * as React from 'react';
-import ButtonUnstyled, {
- buttonUnstyledClasses,
- ButtonUnstyledTypeMap,
-} from '@mui/base/ButtonUnstyled';
+import { Button, buttonClasses, ButtonTypeMap } from '@mui/base/Button';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '@mui/base/utils';
+
+export default function UnstyledButtonsSpan() {
+ return (
+
+ Button
+
+ Disabled
+
+
+ );
+}
const blue = {
500: '#007FFF',
@@ -13,44 +21,34 @@ const blue = {
700: '#0059B2',
};
-const CustomButton = styled(ButtonUnstyled)`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
background-color: ${blue[600]};
}
- &.${buttonUnstyledClasses.active} {
+ &.${buttonClasses.active} {
background-color: ${blue[700]};
}
- &.${buttonUnstyledClasses.focusVisible} {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
- &.${buttonUnstyledClasses.disabled} {
+ &.${buttonClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
-` as OverridableComponent;
-
-export default function UnstyledButtonsSpan() {
- return (
-
- Button
-
- Disabled
-
-
- );
-}
+` as PolymorphicComponent;
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSpan.tsx.preview
index 456f8c68ebbaf6..c38f8399833ef2 100644
--- a/docs/data/base/components/button/UnstyledButtonsSpan.tsx.preview
+++ b/docs/data/base/components/button/UnstyledButtonsSpan.tsx.preview
@@ -1,4 +1,4 @@
-Button
-
+Button
+
Disabled
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js
new file mode 100644
index 00000000000000..07b3949ac8f65e
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js
@@ -0,0 +1,62 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSpan() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx
new file mode 100644
index 00000000000000..07b3949ac8f65e
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx
@@ -0,0 +1,62 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSpan() {
+ return (
+
+
+
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+function Styles() {
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx.preview
new file mode 100644
index 00000000000000..f5854b7a13d486
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx.preview
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js
new file mode 100644
index 00000000000000..45dd963617f567
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js
@@ -0,0 +1,53 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+
+export default function UnstyledButtonsSpan() {
+ return (
+
+ Button
+
+ Disabled
+
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ color: white;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
+ cursor: pointer;
+ transition: all 150ms ease;
+ border: none;
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+`;
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx
new file mode 100644
index 00000000000000..28456f29f69b20
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx
@@ -0,0 +1,54 @@
+import * as React from 'react';
+import { Button, buttonClasses, ButtonTypeMap } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+import { PolymorphicComponent } from '@mui/base/utils';
+
+export default function UnstyledButtonsSpan() {
+ return (
+
+ Button
+
+ Disabled
+
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const CustomButton = styled(Button)`
+ font-family: 'IBM Plex Sans', sans-serif;
+ font-size: 0.875rem;
+ line-height: 1.5;
+ background-color: ${blue[500]};
+ color: white;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
+ cursor: pointer;
+ transition: all 150ms ease;
+ border: none;
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
+ outline: none;
+ }
+
+ &.${buttonClasses.disabled} {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+` as PolymorphicComponent;
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx.preview
new file mode 100644
index 00000000000000..c38f8399833ef2
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx.preview
@@ -0,0 +1,4 @@
+Button
+
+ Disabled
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js
new file mode 100644
index 00000000000000..4af8f4712b740c
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js
@@ -0,0 +1,36 @@
+import * as React from 'react';
+import PropTypes from 'prop-types';
+import { Button } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+ Button
+
+
+ Disabled
+
+
+ );
+}
+
+const CustomButton = React.forwardRef((props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+});
+
+CustomButton.propTypes = {
+ className: PropTypes.string,
+};
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx
new file mode 100644
index 00000000000000..e21014a45ef581
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx
@@ -0,0 +1,33 @@
+import * as React from 'react';
+import { Button, ButtonProps } from '@mui/base/Button';
+import Stack from '@mui/material/Stack';
+import clsx from 'clsx';
+
+export default function UnstyledButtonsSimple() {
+ return (
+
+
+ Button
+
+
+ Disabled
+
+
+ );
+}
+
+const CustomButton = React.forwardRef(
+ (props, ref) => {
+ const { className, ...other } = props;
+ return (
+
+ );
+ },
+);
diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview
new file mode 100644
index 00000000000000..9b004d3295d09c
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview
@@ -0,0 +1,6 @@
+
+ Button
+
+
+ Disabled
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UnstyledLinkButton.js b/docs/data/base/components/button/UnstyledLinkButton.js
new file mode 100644
index 00000000000000..aef8f238b46b07
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledLinkButton.js
@@ -0,0 +1,58 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+import Link from 'next/link';
+
+export default function UnstyledLinkButton() {
+ return (
+
+ Standard link
+
+ Next link
+
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const grey = {
+ 100: '#eaeef2',
+ 300: '#afb8c1',
+ 900: '#24292f',
+};
+
+const CustomButton = styled(Button)(
+ ({ theme }) => `
+ font-family: IBM Plex Sans, sans-serif;
+ font-weight: bold;
+ font-size: 0.875rem;
+ background-color: ${blue[500]};
+ padding: 8px 16px;
+ border-radius: 8px;
+ line-height: 1.5;
+ color: white;
+ transition: all 150ms ease;
+ cursor: pointer;
+ border: none;
+ box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ outline: none;
+ }
+ `,
+);
diff --git a/docs/data/base/components/button/UnstyledLinkButton.tsx b/docs/data/base/components/button/UnstyledLinkButton.tsx
new file mode 100644
index 00000000000000..aef8f238b46b07
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledLinkButton.tsx
@@ -0,0 +1,58 @@
+import * as React from 'react';
+import { Button, buttonClasses } from '@mui/base/Button';
+import { styled } from '@mui/system';
+import Stack from '@mui/material/Stack';
+import Link from 'next/link';
+
+export default function UnstyledLinkButton() {
+ return (
+
+ Standard link
+
+ Next link
+
+
+ );
+}
+
+const blue = {
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 700: '#0059B2',
+};
+
+const grey = {
+ 100: '#eaeef2',
+ 300: '#afb8c1',
+ 900: '#24292f',
+};
+
+const CustomButton = styled(Button)(
+ ({ theme }) => `
+ font-family: IBM Plex Sans, sans-serif;
+ font-weight: bold;
+ font-size: 0.875rem;
+ background-color: ${blue[500]};
+ padding: 8px 16px;
+ border-radius: 8px;
+ line-height: 1.5;
+ color: white;
+ transition: all 150ms ease;
+ cursor: pointer;
+ border: none;
+ box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]};
+
+ &:hover {
+ background-color: ${blue[600]};
+ }
+
+ &.${buttonClasses.active} {
+ background-color: ${blue[700]};
+ }
+
+ &.${buttonClasses.focusVisible} {
+ box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ outline: none;
+ }
+ `,
+);
diff --git a/docs/data/base/components/button/UnstyledLinkButton.tsx.preview b/docs/data/base/components/button/UnstyledLinkButton.tsx.preview
new file mode 100644
index 00000000000000..9c0010de1b136a
--- /dev/null
+++ b/docs/data/base/components/button/UnstyledLinkButton.tsx.preview
@@ -0,0 +1,4 @@
+Standard link
+
+ Next link
+
\ No newline at end of file
diff --git a/docs/data/base/components/button/UseButton.js b/docs/data/base/components/button/UseButton.js
index ceafaf07419768..86fa65d66bcef7 100644
--- a/docs/data/base/components/button/UseButton.js
+++ b/docs/data/base/components/button/UseButton.js
@@ -1,10 +1,49 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
-import { useButton } from '@mui/base/ButtonUnstyled';
+
+import { useButton } from '@mui/base/useButton';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+const CustomButton = React.forwardRef(function CustomButton(props, ref) {
+ const { children, disabled } = props;
+ const { active, focusVisible, getRootProps } = useButton({
+ ...props,
+ rootRef: ref,
+ });
+
+ const classes = {
+ active,
+ disabled,
+ focusVisible,
+ };
+
+ return (
+
+ {children}
+
+ );
+});
+
+CustomButton.propTypes = {
+ children: PropTypes.node,
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled: PropTypes.bool,
+};
+
+export default function UseButton() {
+ return (
+
+ console.log('click!')}>Button
+ Disabled
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
@@ -12,15 +51,16 @@ const blue = {
};
const CustomButtonRoot = styled('button')`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
@@ -32,7 +72,7 @@ const CustomButtonRoot = styled('button')`
}
&.focusVisible {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
@@ -41,36 +81,3 @@ const CustomButtonRoot = styled('button')`
cursor: not-allowed;
}
`;
-
-const CustomButton = React.forwardRef(function CustomButton(props, ref) {
- const { children } = props;
- const { active, disabled, focusVisible, getRootProps } = useButton({
- ...props,
- ref,
- });
-
- const classes = {
- active,
- disabled,
- focusVisible,
- };
-
- return (
-
- {children}
-
- );
-});
-
-CustomButton.propTypes = {
- children: PropTypes.node,
-};
-
-export default function UseButton() {
- return (
-
- console.log('click!')}>Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/UseButton.tsx b/docs/data/base/components/button/UseButton.tsx
index 8d42e9dbbc4587..5a5186b11fdb42 100644
--- a/docs/data/base/components/button/UseButton.tsx
+++ b/docs/data/base/components/button/UseButton.tsx
@@ -1,9 +1,42 @@
import * as React from 'react';
import clsx from 'clsx';
-import { ButtonUnstyledProps, useButton } from '@mui/base/ButtonUnstyled';
+import { ButtonProps } from '@mui/base/Button';
+import { useButton } from '@mui/base/useButton';
import { styled } from '@mui/system';
import Stack from '@mui/material/Stack';
+const CustomButton = React.forwardRef(function CustomButton(
+ props: ButtonProps,
+ ref: React.ForwardedRef,
+) {
+ const { children, disabled } = props;
+ const { active, focusVisible, getRootProps } = useButton({
+ ...props,
+ rootRef: ref,
+ });
+
+ const classes = {
+ active,
+ disabled,
+ focusVisible,
+ };
+
+ return (
+
+ {children}
+
+ );
+});
+
+export default function UseButton() {
+ return (
+
+ console.log('click!')}>Button
+ Disabled
+
+ );
+}
+
const blue = {
500: '#007FFF',
600: '#0072E5',
@@ -11,15 +44,16 @@ const blue = {
};
const CustomButtonRoot = styled('button')`
- font-family: IBM Plex Sans, sans-serif;
- font-weight: bold;
+ font-family: 'IBM Plex Sans', sans-serif;
font-size: 0.875rem;
+ line-height: 1.5;
background-color: ${blue[500]};
- padding: 12px 24px;
- border-radius: 12px;
color: white;
- transition: all 150ms ease;
+ border-radius: 8px;
+ font-weight: 600;
+ padding: 8px 16px;
cursor: pointer;
+ transition: all 150ms ease;
border: none;
&:hover {
@@ -31,7 +65,7 @@ const CustomButtonRoot = styled('button')`
}
&.focusVisible {
- box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
+ box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5);
outline: none;
}
@@ -40,35 +74,3 @@ const CustomButtonRoot = styled('button')`
cursor: not-allowed;
}
`;
-
-const CustomButton = React.forwardRef(function CustomButton(
- props: ButtonUnstyledProps,
- ref: React.ForwardedRef,
-) {
- const { children } = props;
- const { active, disabled, focusVisible, getRootProps } = useButton({
- ...props,
- ref,
- });
-
- const classes = {
- active,
- disabled,
- focusVisible,
- };
-
- return (
-
- {children}
-
- );
-});
-
-export default function UseButton() {
- return (
-
- console.log('click!')}>Button
- Disabled
-
- );
-}
diff --git a/docs/data/base/components/button/button-pt.md b/docs/data/base/components/button/button-pt.md
index f175246123d5c9..2905df2ea70659 100644
--- a/docs/data/base/components/button/button-pt.md
+++ b/docs/data/base/components/button/button-pt.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Componente e Hook do botão React sem estilo
components: ButtonUnstyled
githubLabel: 'component: button'
@@ -20,7 +20,7 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/button/
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import ButtonUnstyled from '@mui/base/ButtonUnstyled';
@@ -51,7 +51,7 @@ The `ButtonUnstyled` component is composed of a root `
);
}
-
-export default function UseFormControl() {
- return (
-
-
-
-
- );
-}
diff --git a/docs/data/base/components/form-control/UseFormControl.tsx b/docs/data/base/components/form-control/UseFormControl.tsx
index 3af02e62afc7ad..bafa8a4f24ad97 100644
--- a/docs/data/base/components/form-control/UseFormControl.tsx
+++ b/docs/data/base/components/form-control/UseFormControl.tsx
@@ -1,10 +1,17 @@
import * as React from 'react';
-import FormControlUnstyled, {
- useFormControlUnstyledContext,
-} from '@mui/base/FormControlUnstyled';
+import { FormControl, useFormControlContext } from '@mui/base/FormControl';
+
+export default function UseFormControl() {
+ return (
+
+
+
+
+ );
+}
function CustomInput() {
- const formControlContext = useFormControlUnstyledContext();
+ const formControlContext = useFormControlContext();
if (formControlContext === undefined) {
return null;
@@ -26,7 +33,7 @@ function CustomInput() {
}
function ControlStateDisplay() {
- const formControlContext = useFormControlUnstyledContext();
+ const formControlContext = useFormControlContext();
if (formControlContext === undefined) {
return null;
}
@@ -40,12 +47,3 @@ function ControlStateDisplay() {
);
}
-
-export default function UseFormControl() {
- return (
-
-
-
-
- );
-}
diff --git a/docs/data/base/components/form-control/UseFormControl.tsx.preview b/docs/data/base/components/form-control/UseFormControl.tsx.preview
index b2651ef7e5981c..611748df318035 100644
--- a/docs/data/base/components/form-control/UseFormControl.tsx.preview
+++ b/docs/data/base/components/form-control/UseFormControl.tsx.preview
@@ -1,4 +1,4 @@
-
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/data/base/components/form-control/form-control-pt.md b/docs/data/base/components/form-control/form-control-pt.md
index 68c741d1a0bb16..db275489b29bcc 100644
--- a/docs/data/base/components/form-control/form-control-pt.md
+++ b/docs/data/base/components/form-control/form-control-pt.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Unstyled React Form Control component and hook
components: FormControlUnstyled
githubLabel: 'component: FormControl'
@@ -7,7 +7,7 @@ githubLabel: 'component: FormControl'
# Unstyled form control
-
The FormControlUnstyled component is a utility that lets you associate a form input with auxillary components, such as labels, error indicators, or helper text.
+
The FormControlUnstyled component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.
## Introduction
@@ -21,7 +21,7 @@ For instance, you may want to show an additional element asking the user to ente
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import FormControlUnstyled from '@mui/base/FormControlUnstyled';
diff --git a/docs/data/base/components/form-control/form-control-zh.md b/docs/data/base/components/form-control/form-control-zh.md
index 68c741d1a0bb16..db275489b29bcc 100644
--- a/docs/data/base/components/form-control/form-control-zh.md
+++ b/docs/data/base/components/form-control/form-control-zh.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Unstyled React Form Control component and hook
components: FormControlUnstyled
githubLabel: 'component: FormControl'
@@ -7,7 +7,7 @@ githubLabel: 'component: FormControl'
# Unstyled form control
-
The FormControlUnstyled component is a utility that lets you associate a form input with auxillary components, such as labels, error indicators, or helper text.
+
The FormControlUnstyled component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.
## Introduction
@@ -21,7 +21,7 @@ For instance, you may want to show an additional element asking the user to ente
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import FormControlUnstyled from '@mui/base/FormControlUnstyled';
diff --git a/docs/data/base/components/form-control/form-control.md b/docs/data/base/components/form-control/form-control.md
index 6532f72bd75d0e..cd7ee94950fd2c 100644
--- a/docs/data/base/components/form-control/form-control.md
+++ b/docs/data/base/components/form-control/form-control.md
@@ -1,68 +1,72 @@
---
-product: base
-title: Unstyled React Form Control component and hook
-components: FormControlUnstyled
+productId: base-ui
+title: React Form Control component and hook
+components: FormControl
+hooks: useFormControlContext
githubLabel: 'component: FormControl'
---
-# Unstyled Form Control
+# Form Control
-
The FormControlUnstyled component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.
+
The Form Control component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.
+
+{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
+
+{{"component": "modules/components/ComponentPageTabs.js"}}
## Introduction
-`FormControlUnstyled` is a utility that wraps an input component with other associated components in order to make the state of the input available to those components.
+Form Control is a utility that wraps an input component with other associated components in order to make the state of the input available to those components.
For instance, you may want to show an additional element asking the user to enter a value if the input is empty, or display a warning icon if the entered value is incorrect.
-{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
-
## Component
-### Usage
-
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
-
```jsx
-import FormControlUnstyled from '@mui/base/FormControlUnstyled';
-
-export default function MyApp() {
- return (
-
- {/* and/or other contents of the form */}
-
- );
-}
+import { FormControl } from '@mui/base/FormControl';
```
-### Basics
-
-`FormControlUnstyled` wraps around the elements of a form that need access to the state of an ``.
+Form Control wraps around the elements of a form that need access to the state of an ``.
For instance, if the form's **Submit** button needs to change states after the user enters information, then the component will be structured like this:
```jsx
-
+Submit
-
+
+```
+
+The following demo shows how to create and style a form that uses Form Control to wrap the elements of the form.
+Note that it also uses the `useFormControlContext` hook in order to pass props to the custom Input—see the [Hook](#hook) section below for more details.
+
+{{"demo": "BasicFormControl"}}
+
+### Usage with TypeScript
+
+In TypeScript, you can specify the custom component type used in the `slots.root` as a generic parameter of the unstyled component.
+This way, you can safely provide the custom root's props directly on the component:
+
+```tsx
+ slots={{ root: CustomComponent }} customProp />
```
-The following demo shows how to create and style a form that uses `FormControlUnstyled` to wrap the elements of the form.
-Note that it also uses the `useFormControlUnstyledContext` hook in order to pass props to the custom `InputUnstyled`—see the [Hook section](#hook) below for more details.
+The same applies for props specific to custom primitive elements:
-{{"demo": "BasicFormControl.js"}}
+```tsx
+ slots={{ root: 'button' }} onClick={() => {}} />
+```
## Hook
```jsx
-import { useFormControlUnstyledContext } from '@mui/base/FormControlUnstyled';
+import { useFormControlContext } from '@mui/base/FormControl';
```
-The `useFormControlUnstyledContext` hook reads the context provided by `FormControlUnstyled`.
-This hook lets you work with custom input components inside of the form control.
+The `useFormControlContext` hook reads the context provided by Form Control.
+This hook lets you work with custom input components inside of the Form Control.
You can also use it to read the form control's state and react to its changes in a custom component.
-Hooks _do not_ support [slot props](#slot-props), but they do support [customization props](#customization).
+Hooks _do not_ support [slot props](#custom-structure), but they do support [customization props](#customization).
:::info
Hooks give you the most room for customization, but require more work to implement.
@@ -73,33 +77,21 @@ You may not need to use hooks unless you find that you're limited by the customi
The demo below shows how to integrate this hook with its component counterpart:
-- `CustomInput` is a wrapper around a native HTML `` that adds `FormControlUnstyled` integration.
+- `CustomInput` is a wrapper around a native HTML `` that adds Form Control integration.
- `ControlStateDisplay` reads the state of the form control and displays it as text.
{{"demo": "UseFormControl.js", "defaultCodeOpen": false}}
-Note that even though `FormControlUnstyled` supports both controlled and uncontrolled-style APIs
-(i.e. it accepts `value` and `defaultValue` props), `useFormControlUnstyledContext` returns only the controlled `value`.
-This way, you don't have to implement both in your custom input—`FormControlUnstyled` does this for you.
-
-`useFormControlUnstyledContext` returns an object with the following fields:
+Note that even though Form Control supports both controlled and uncontrolled-style APIs (i.e. it accepts `value` and `defaultValue` props), `useFormControlContext` returns only the controlled `value`.
+This way, you don't have to implement both in your custom input—Form Control does this for you.
-| Name | Type | Description |
-| ---------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `disabled` | boolean | Represents the value of the FormControlUnstyled's `disabled` prop. |
-| `error` | boolean | Represents the value of the `FormControlUnstyled` component's `error` prop. Note that it is not calculated automatically (i.e. it's not set when `required: true` and `value: ''`). |
-| `filled` | boolean | Set to `true` if `value` is not empty. |
-| `focused` | boolean | Set to `true` if the wrapped input has received focus. |
-| `required` | boolean | Represents the value of the `FormControlUnstyled` component's `required` prop. |
-| `value` | unknown | The current value of the form control. |
+:::info
-The following callbacks are also part of the returned object—they are meant to be used when creating custom inputs:
+- A component is **controlled** when it's managed by its parent using props.
+- A component is **uncontrolled** when it's managed by its own local state.
-| Name | Type | Description |
-| ---------- | ------------------------- | ------------------------------------------------------------- |
-| `onChange` | React.ChangeEvent => void | Value change handler. Should be forwarded to the inner input. |
-| `onBlur` | () => void | Focus change handler. Should be forwarded to the inner input. |
-| `onFocus` | () => void | Focus change handler. Should be forwarded to the inner input. |
+Learn more about controlled and uncontrolled components in the [React documentation](https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components).
+:::
## Customization
@@ -110,9 +102,9 @@ For the sake of simplicity, demos and code snippets primarily feature components
### Accessing the form control state
-You can access the state of the form control by providing a function as a child of the `FormControlUnstyled`.
+You can access the state of the Form Control by providing a function as a child.
The state will be provided as a parameter to this function.
-The following demo shows how to access the state of the form control in an `InputUnstyled` component nested inside of `FormControlUnstyled`:
+The following demo shows how to access the state of the Form Control in an Input component nested inside:
{{"demo": "FormControlFunctionChild.js"}}
diff --git a/docs/data/base/components/input/InputAdornments.js b/docs/data/base/components/input/InputAdornments.js
index 25f30675047bc8..cd730267f763e1 100644
--- a/docs/data/base/components/input/InputAdornments.js
+++ b/docs/data/base/components/input/InputAdornments.js
@@ -1,97 +1,16 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
-import ButtonUnstyled from '@mui/base/ButtonUnstyled';
-import InputUnstyled, { inputUnstyledClasses } from '@mui/base/InputUnstyled';
+import { Button } from '@mui/base/Button';
+import { Input, inputClasses } from '@mui/base/Input';
import Visibility from '@mui/icons-material/Visibility';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { styled } from '@mui/system';
-const blue = {
- 100: '#DAECFF',
- 200: '#80BFFF',
- 400: '#3399FF',
- 500: '#007FFF',
- 600: '#0072E5',
-};
-
-const grey = {
- 50: '#F3F6F9',
- 100: '#E7EBF0',
- 200: '#E0E3E7',
- 300: '#CDD2D7',
- 400: '#B2BAC2',
- 500: '#A0AAB4',
- 600: '#6F7E8C',
- 700: '#3E5060',
- 800: '#2D3843',
- 900: '#1A2027',
-};
-
-const StyledInputRoot = styled('div')(
- ({ theme }) => `
- font-family: IBM Plex Sans, sans-serif;
- font-weight: 400;
- border-radius: 12px;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]};
- background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
- border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
- box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
- display: flex;
- align-items: center;
- justify-content: center;
-
-
- &.${inputUnstyledClasses.focused} {
- border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
- }
-
- &:hover {
- border-color: ${blue[400]};
- }
-`,
-);
-
-const StyledInputElement = styled('input')(
- ({ theme }) => `
- font-size: 0.875rem;
- font-family: inherit;
- font-weight: 400;
- line-height: 1.5;
- flex-grow: 1;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
- background: inherit;
- border: none;
- border-radius: inherit;
- padding: 12px 12px;
- outline: 0;
-`,
-);
-
-const IconButton = styled(ButtonUnstyled)(
- ({ theme }) => `
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border: none;
- background: inherit;
- cursor: pointer;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[700]};
- `,
-);
-
-const InputAdornment = styled('div')`
- margin: 8px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
-`;
-
const CustomInput = React.forwardRef(function CustomInput(props, ref) {
const { slots, ...other } = props;
return (
- * + *': { ml: 1 } }}>
+ kg}
@@ -166,3 +91,89 @@ export default function InputAdornments() {
);
}
+
+const blue = {
+ 100: '#DAECFF',
+ 200: '#80BFFF',
+ 400: '#3399FF',
+ 500: '#007FFF',
+ 600: '#0072E5',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+const StyledInputRoot = styled('div')(
+ ({ theme }) => `
+ font-family: IBM Plex Sans, sans-serif;
+ font-weight: 400;
+ border-radius: 8px;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]};
+ background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
+ border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
+ box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+
+ &.${inputClasses.focused} {
+ border-color: ${blue[400]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ &:hover {
+ border-color: ${blue[400]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
+`,
+);
+
+const StyledInputElement = styled('input')(
+ ({ theme }) => `
+ font-size: 0.875rem;
+ font-family: inherit;
+ font-weight: 400;
+ line-height: 1.5;
+ flex-grow: 1;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
+ background: inherit;
+ border: none;
+ border-radius: inherit;
+ padding: 8px 12px;
+ outline: 0;
+`,
+);
+
+const IconButton = styled(Button)(
+ ({ theme }) => `
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ background: inherit;
+ cursor: pointer;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[700]};
+ `,
+);
+
+const InputAdornment = styled('div')`
+ margin: 8px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+`;
diff --git a/docs/data/base/components/input/InputAdornments.tsx b/docs/data/base/components/input/InputAdornments.tsx
index 7323943130a11d..a70f25adc30bdd 100644
--- a/docs/data/base/components/input/InputAdornments.tsx
+++ b/docs/data/base/components/input/InputAdornments.tsx
@@ -1,14 +1,95 @@
import * as React from 'react';
import Box from '@mui/material/Box';
-import ButtonUnstyled from '@mui/base/ButtonUnstyled';
-import InputUnstyled, {
- InputUnstyledProps,
- inputUnstyledClasses,
-} from '@mui/base/InputUnstyled';
+import { Button } from '@mui/base/Button';
+import { Input, InputProps, inputClasses } from '@mui/base/Input';
import Visibility from '@mui/icons-material/Visibility';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { styled } from '@mui/system';
+const CustomInput = React.forwardRef(function CustomInput(
+ props: InputProps,
+ ref: React.ForwardedRef,
+) {
+ const { slots, ...other } = props;
+ return (
+
+ );
+});
+
+interface State {
+ amount: string;
+ password: string;
+ weight: string;
+ weightRange: string;
+ showPassword: boolean;
+}
+
+export default function InputAdornments() {
+ const [values, setValues] = React.useState({
+ amount: '',
+ password: '',
+ weight: '',
+ weightRange: '',
+ showPassword: false,
+ });
+
+ const handleChange =
+ (prop: keyof State) => (event: React.ChangeEvent) => {
+ setValues({ ...values, [prop]: event.target.value });
+ };
+
+ const handleClickShowPassword = () => {
+ setValues({
+ ...values,
+ showPassword: !values.showPassword,
+ });
+ };
+
+ const handleMouseDownPassword = (event: React.MouseEvent) => {
+ event.preventDefault();
+ };
+
+ return (
+
+ kg}
+ />
+
+
+ {values.showPassword ? : }
+
+
+ }
+ />
+
+ );
+}
+
const blue = {
100: '#DAECFF',
200: '#80BFFF',
@@ -34,7 +115,7 @@ const StyledInputRoot = styled('div')(
({ theme }) => `
font-family: IBM Plex Sans, sans-serif;
font-weight: 400;
- border-radius: 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -44,14 +125,19 @@ const StyledInputRoot = styled('div')(
justify-content: center;
- &.${inputUnstyledClasses.focused} {
+ &.${inputClasses.focused} {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}
&:hover {
border-color: ${blue[400]};
}
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
`,
);
@@ -66,12 +152,12 @@ const StyledInputElement = styled('input')(
background: inherit;
border: none;
border-radius: inherit;
- padding: 12px 12px;
+ padding: 8px 12px;
outline: 0;
`,
);
-const IconButton = styled(ButtonUnstyled)(
+const IconButton = styled(Button)(
({ theme }) => `
display: inline-flex;
align-items: center;
@@ -89,81 +175,3 @@ const InputAdornment = styled('div')`
align-items: center;
justify-content: center;
`;
-
-const CustomInput = React.forwardRef(function CustomInput(
- props: InputUnstyledProps,
- ref: React.ForwardedRef,
-) {
- const { slots, ...other } = props;
- return (
-
- );
-});
-
-interface State {
- amount: string;
- password: string;
- weight: string;
- weightRange: string;
- showPassword: boolean;
-}
-
-export default function InputAdornments() {
- const [values, setValues] = React.useState({
- amount: '',
- password: '',
- weight: '',
- weightRange: '',
- showPassword: false,
- });
-
- const handleChange =
- (prop: keyof State) => (event: React.ChangeEvent) => {
- setValues({ ...values, [prop]: event.target.value });
- };
-
- const handleClickShowPassword = () => {
- setValues({
- ...values,
- showPassword: !values.showPassword,
- });
- };
-
- const handleMouseDownPassword = (event: React.MouseEvent) => {
- event.preventDefault();
- };
-
- return (
- * + *': { ml: 1 } }}>
- kg}
- />
-
-
- {values.showPassword ? : }
-
-
- }
- />
-
- );
-}
diff --git a/docs/data/base/components/input/InputMultiline.js b/docs/data/base/components/input/InputMultiline.js
index 533e652264b6e8..ee6e92fad87c95 100644
--- a/docs/data/base/components/input/InputMultiline.js
+++ b/docs/data/base/components/input/InputMultiline.js
@@ -1,7 +1,23 @@
import * as React from 'react';
-import InputUnstyled from '@mui/base/InputUnstyled';
+import { Input } from '@mui/base/Input';
import { styled } from '@mui/system';
+const CustomInput = React.forwardRef(function CustomInput(props, ref) {
+ return (
+
+ );
+});
+
+export default function InputMultiline() {
+ return (
+
+ );
+}
+
const blue = {
100: '#DAECFF',
200: '#80BFFF',
@@ -30,8 +46,8 @@ const StyledInputElement = styled('input')(
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -43,7 +59,12 @@ const StyledInputElement = styled('input')(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
@@ -57,9 +78,9 @@ const StyledTextareaElement = styled('textarea', {
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ line-height: 1.5rem;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -71,23 +92,12 @@ const StyledTextareaElement = styled('textarea', {
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
-
-const CustomInput = React.forwardRef(function CustomInput(props, ref) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return (
-
- );
-}
diff --git a/docs/data/base/components/input/InputMultiline.tsx b/docs/data/base/components/input/InputMultiline.tsx
index e377f1de40adc7..f0f32e173784a9 100644
--- a/docs/data/base/components/input/InputMultiline.tsx
+++ b/docs/data/base/components/input/InputMultiline.tsx
@@ -1,7 +1,26 @@
import * as React from 'react';
-import InputUnstyled, { InputUnstyledProps } from '@mui/base/InputUnstyled';
+import { Input, InputProps } from '@mui/base/Input';
import { styled } from '@mui/system';
+const CustomInput = React.forwardRef(function CustomInput(
+ props: InputProps,
+ ref: React.ForwardedRef,
+) {
+ return (
+
+ );
+});
+
+export default function InputMultiline() {
+ return (
+
+ );
+}
+
const blue = {
100: '#DAECFF',
200: '#80BFFF',
@@ -30,8 +49,8 @@ const StyledInputElement = styled('input')(
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -43,7 +62,12 @@ const StyledInputElement = styled('input')(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
@@ -57,9 +81,9 @@ const StyledTextareaElement = styled('textarea', {
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ line-height: 1.5rem;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -71,26 +95,12 @@ const StyledTextareaElement = styled('textarea', {
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
-
-const CustomInput = React.forwardRef(function CustomInput(
- props: InputUnstyledProps,
- ref: React.ForwardedRef,
-) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return (
-
- );
-}
diff --git a/docs/data/base/components/input/InputMultilineAutosize.js b/docs/data/base/components/input/InputMultilineAutosize.js
index c202de92f4a90e..68334fb0cc9e09 100644
--- a/docs/data/base/components/input/InputMultilineAutosize.js
+++ b/docs/data/base/components/input/InputMultilineAutosize.js
@@ -1,8 +1,24 @@
import * as React from 'react';
-import InputUnstyled from '@mui/base/InputUnstyled';
-import TextareaAutosize from '@mui/base/TextareaAutosize';
+import { Input } from '@mui/base/Input';
+import { TextareaAutosize } from '@mui/base/TextareaAutosize';
import { styled } from '@mui/system';
+const CustomInput = React.forwardRef(function CustomInput(props, ref) {
+ return (
+
+ );
+});
+
+export default function InputMultilineAutosize() {
+ return (
+
+ );
+}
+
const blue = {
100: '#DAECFF',
200: '#80BFFF',
@@ -31,8 +47,8 @@ const StyledInputElement = styled('input')(
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -44,7 +60,12 @@ const StyledInputElement = styled('input')(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
@@ -55,9 +76,9 @@ const StyledTextareaElement = styled(TextareaAutosize)(
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ line-height: 1.5rem;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -69,23 +90,12 @@ const StyledTextareaElement = styled(TextareaAutosize)(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
-
-const CustomInput = React.forwardRef(function CustomInput(props, ref) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return (
-
- );
-}
diff --git a/docs/data/base/components/input/InputMultilineAutosize.tsx b/docs/data/base/components/input/InputMultilineAutosize.tsx
index 7b4e67b8ec6375..712aa421366615 100644
--- a/docs/data/base/components/input/InputMultilineAutosize.tsx
+++ b/docs/data/base/components/input/InputMultilineAutosize.tsx
@@ -1,8 +1,27 @@
import * as React from 'react';
-import InputUnstyled, { InputUnstyledProps } from '@mui/base/InputUnstyled';
-import TextareaAutosize from '@mui/base/TextareaAutosize';
+import { Input, InputProps } from '@mui/base/Input';
+import { TextareaAutosize } from '@mui/base/TextareaAutosize';
import { styled } from '@mui/system';
+const CustomInput = React.forwardRef(function CustomInput(
+ props: InputProps,
+ ref: React.ForwardedRef,
+) {
+ return (
+
+ );
+});
+
+export default function InputMultilineAutosize() {
+ return (
+
+ );
+}
+
const blue = {
100: '#DAECFF',
200: '#80BFFF',
@@ -31,8 +50,8 @@ const StyledInputElement = styled('input')(
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -44,7 +63,12 @@ const StyledInputElement = styled('input')(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
@@ -55,9 +79,9 @@ const StyledTextareaElement = styled(TextareaAutosize)(
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
+ line-height: 1.5rem;
+ padding: 8px 12px;
+ border-radius: 8px;
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
@@ -69,26 +93,12 @@ const StyledTextareaElement = styled(TextareaAutosize)(
&:focus {
border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
}
`,
);
-
-const CustomInput = React.forwardRef(function CustomInput(
- props: InputUnstyledProps,
- ref: React.ForwardedRef,
-) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return (
-
- );
-}
diff --git a/docs/data/base/components/input/UnstyledInputBasic.js b/docs/data/base/components/input/UnstyledInputBasic.js
deleted file mode 100644
index be86fab1ec7dfd..00000000000000
--- a/docs/data/base/components/input/UnstyledInputBasic.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import * as React from 'react';
-import InputUnstyled from '@mui/base/InputUnstyled';
-import { styled } from '@mui/system';
-
-const blue = {
- 100: '#DAECFF',
- 200: '#80BFFF',
- 400: '#3399FF',
- 500: '#007FFF',
- 600: '#0072E5',
-};
-
-const grey = {
- 50: '#F3F6F9',
- 100: '#E7EBF0',
- 200: '#E0E3E7',
- 300: '#CDD2D7',
- 400: '#B2BAC2',
- 500: '#A0AAB4',
- 600: '#6F7E8C',
- 700: '#3E5060',
- 800: '#2D3843',
- 900: '#1A2027',
-};
-
-const StyledInputElement = styled('input')(
- ({ theme }) => `
- width: 320px;
- font-family: IBM Plex Sans, sans-serif;
- font-size: 0.875rem;
- font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
- background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
- border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
- box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
-
- &:hover {
- border-color: ${blue[400]};
- }
-
- &:focus {
- border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
- }
-`,
-);
-
-const CustomInput = React.forwardRef(function CustomInput(props, ref) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return ;
-}
diff --git a/docs/data/base/components/input/UnstyledInputBasic.tsx b/docs/data/base/components/input/UnstyledInputBasic.tsx
deleted file mode 100644
index ec7e71c96c72c7..00000000000000
--- a/docs/data/base/components/input/UnstyledInputBasic.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import * as React from 'react';
-import InputUnstyled, { InputUnstyledProps } from '@mui/base/InputUnstyled';
-import { styled } from '@mui/system';
-
-const blue = {
- 100: '#DAECFF',
- 200: '#80BFFF',
- 400: '#3399FF',
- 500: '#007FFF',
- 600: '#0072E5',
-};
-
-const grey = {
- 50: '#F3F6F9',
- 100: '#E7EBF0',
- 200: '#E0E3E7',
- 300: '#CDD2D7',
- 400: '#B2BAC2',
- 500: '#A0AAB4',
- 600: '#6F7E8C',
- 700: '#3E5060',
- 800: '#2D3843',
- 900: '#1A2027',
-};
-
-const StyledInputElement = styled('input')(
- ({ theme }) => `
- width: 320px;
- font-family: IBM Plex Sans, sans-serif;
- font-size: 0.875rem;
- font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
- background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
- border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
- box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
-
- &:hover {
- border-color: ${blue[400]};
- }
-
- &:focus {
- border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
- }
-`,
-);
-
-const CustomInput = React.forwardRef(function CustomInput(
- props: InputUnstyledProps,
- ref: React.ForwardedRef,
-) {
- return (
-
- );
-});
-
-export default function UnstyledInputBasic() {
- return ;
-}
diff --git a/docs/data/base/components/input/UnstyledInputBasic/css/index.js b/docs/data/base/components/input/UnstyledInputBasic/css/index.js
new file mode 100644
index 00000000000000..a64877d635bed1
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/css/index.js
@@ -0,0 +1,85 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+export default function UnstyledInputBasic() {
+ return (
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+function Styles() {
+ // Replace this with your app logic for determining dark mode
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx
new file mode 100644
index 00000000000000..a64877d635bed1
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx
@@ -0,0 +1,85 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+export default function UnstyledInputBasic() {
+ return (
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+function Styles() {
+ // Replace this with your app logic for determining dark mode
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx.preview b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx.preview
new file mode 100644
index 00000000000000..b4003b693f4f3a
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx.preview
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/input/UnstyledInputBasic/system/index.js b/docs/data/base/components/input/UnstyledInputBasic/system/index.js
new file mode 100644
index 00000000000000..cd745b1e1a8d5a
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/system/index.js
@@ -0,0 +1,62 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { styled } from '@mui/system';
+
+const CustomInput = React.forwardRef(function CustomInput(props, ref) {
+ return ;
+});
+
+export default function UnstyledInputBasic() {
+ return ;
+}
+
+const blue = {
+ 100: '#DAECFF',
+ 200: '#80BFFF',
+ 400: '#3399FF',
+ 500: '#007FFF',
+ 600: '#0072E5',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+const StyledInputElement = styled('input')(
+ ({ theme }) => `
+ width: 320px;
+ font-family: IBM Plex Sans, sans-serif;
+ font-size: 0.875rem;
+ font-weight: 400;
+ line-height: 1.5;
+ padding: 8px 12px;
+ border-radius: 8px;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
+ background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
+ border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
+ box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
+
+ &:hover {
+ border-color: ${blue[400]};
+ }
+
+ &:focus {
+ border-color: ${blue[400]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
+`,
+);
diff --git a/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx b/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx
new file mode 100644
index 00000000000000..1d4631d3080346
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx
@@ -0,0 +1,65 @@
+import * as React from 'react';
+import { Input, InputProps } from '@mui/base/Input';
+import { styled } from '@mui/system';
+
+const CustomInput = React.forwardRef(function CustomInput(
+ props: InputProps,
+ ref: React.ForwardedRef,
+) {
+ return ;
+});
+
+export default function UnstyledInputBasic() {
+ return ;
+}
+
+const blue = {
+ 100: '#DAECFF',
+ 200: '#80BFFF',
+ 400: '#3399FF',
+ 500: '#007FFF',
+ 600: '#0072E5',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+const StyledInputElement = styled('input')(
+ ({ theme }) => `
+ width: 320px;
+ font-family: IBM Plex Sans, sans-serif;
+ font-size: 0.875rem;
+ font-weight: 400;
+ line-height: 1.5;
+ padding: 8px 12px;
+ border-radius: 8px;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
+ background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
+ border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
+ box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]};
+
+ &:hover {
+ border-color: ${blue[400]};
+ }
+
+ &:focus {
+ border-color: ${blue[400]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
+`,
+);
diff --git a/docs/data/base/components/input/UnstyledInputBasic.tsx.preview b/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx.preview
similarity index 100%
rename from docs/data/base/components/input/UnstyledInputBasic.tsx.preview
rename to docs/data/base/components/input/UnstyledInputBasic/system/index.tsx.preview
diff --git a/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.js b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.js
new file mode 100644
index 00000000000000..128b9e468e4288
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.js
@@ -0,0 +1,27 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+export default function UnstyledInputBasic() {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx
new file mode 100644
index 00000000000000..128b9e468e4288
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx
@@ -0,0 +1,27 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+export default function UnstyledInputBasic() {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx.preview b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx.preview
new file mode 100644
index 00000000000000..2431f649ca2a90
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputBasic/tailwind/index.tsx.preview
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction.js b/docs/data/base/components/input/UnstyledInputIntroduction.js
deleted file mode 100644
index 08c9c848375c0e..00000000000000
--- a/docs/data/base/components/input/UnstyledInputIntroduction.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import * as React from 'react';
-import InputUnstyled from '@mui/base/InputUnstyled';
-import { styled } from '@mui/system';
-
-const blue = {
- 100: '#DAECFF',
- 200: '#b6daff',
- 400: '#3399FF',
- 500: '#007FFF',
- 600: '#0072E5',
-};
-
-const grey = {
- 50: '#f6f8fa',
- 100: '#eaeef2',
- 200: '#d0d7de',
- 300: '#afb8c1',
- 400: '#8c959f',
- 500: '#6e7781',
- 600: '#57606a',
- 700: '#424a53',
- 800: '#32383f',
- 900: '#24292f',
-};
-
-const StyledInputElement = styled('input')(
- ({ theme }) => `
- width: 320px;
- font-family: IBM Plex Sans, sans-serif;
- font-size: 0.875rem;
- font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
- background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
- border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
- box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]};
-
- &:hover {
- border-color: ${blue[400]};
- }
-
- &:focus {
- border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
- }
-`,
-);
-
-const CustomInput = React.forwardRef(function CustomInput(props, ref) {
- return (
-
- );
-});
-
-export default function UnstyledInputIntroduction() {
- return ;
-}
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction.tsx b/docs/data/base/components/input/UnstyledInputIntroduction.tsx
deleted file mode 100644
index 7f5703901e9a3b..00000000000000
--- a/docs/data/base/components/input/UnstyledInputIntroduction.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import * as React from 'react';
-import InputUnstyled from '@mui/base/InputUnstyled';
-import { styled } from '@mui/system';
-
-const blue = {
- 100: '#DAECFF',
- 200: '#b6daff',
- 400: '#3399FF',
- 500: '#007FFF',
- 600: '#0072E5',
-};
-
-const grey = {
- 50: '#f6f8fa',
- 100: '#eaeef2',
- 200: '#d0d7de',
- 300: '#afb8c1',
- 400: '#8c959f',
- 500: '#6e7781',
- 600: '#57606a',
- 700: '#424a53',
- 800: '#32383f',
- 900: '#24292f',
-};
-
-const StyledInputElement = styled('input')(
- ({ theme }) => `
- width: 320px;
- font-family: IBM Plex Sans, sans-serif;
- font-size: 0.875rem;
- font-weight: 400;
- line-height: 1.5;
- padding: 12px;
- border-radius: 12px;
- color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
- background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
- border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
- box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]};
-
- &:hover {
- border-color: ${blue[400]};
- }
-
- &:focus {
- border-color: ${blue[400]};
- outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
- }
-`,
-);
-
-const CustomInput = React.forwardRef(function CustomInput(
- props: React.InputHTMLAttributes,
- ref: React.ForwardedRef,
-) {
- return (
-
- );
-});
-
-export default function UnstyledInputIntroduction() {
- return ;
-}
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js
new file mode 100644
index 00000000000000..7db613fae34b34
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js
@@ -0,0 +1,84 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+export default function UnstyledInputIntroduction() {
+ return (
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+function Styles() {
+ // Replace this with your app logic for determining dark mode
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx
new file mode 100644
index 00000000000000..7db613fae34b34
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx
@@ -0,0 +1,84 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+
+export default function UnstyledInputIntroduction() {
+ return (
+
+
+
+
+ );
+}
+
+const cyan = {
+ 50: '#E9F8FC',
+ 100: '#BDEBF4',
+ 200: '#99D8E5',
+ 300: '#66BACC',
+ 400: '#1F94AD',
+ 500: '#0D5463',
+ 600: '#094855',
+ 700: '#063C47',
+ 800: '#043039',
+ 900: '#022127',
+};
+
+const grey = {
+ 50: '#F3F6F9',
+ 100: '#E7EBF0',
+ 200: '#E0E3E7',
+ 300: '#CDD2D7',
+ 400: '#B2BAC2',
+ 500: '#A0AAB4',
+ 600: '#6F7E8C',
+ 700: '#3E5060',
+ 800: '#2D3843',
+ 900: '#1A2027',
+};
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+function Styles() {
+ // Replace this with your app logic for determining dark mode
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+ );
+}
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx.preview b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx.preview
new file mode 100644
index 00000000000000..7ae3c657ead360
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx.preview
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js
new file mode 100644
index 00000000000000..dfd3541fc0e85f
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js
@@ -0,0 +1,63 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { styled } from '@mui/system';
+
+const CustomInput = React.forwardRef(function CustomInput(props, ref) {
+ return ;
+});
+
+export default function UnstyledInputIntroduction() {
+ return ;
+}
+
+const blue = {
+ 100: '#DAECFF',
+ 200: '#b6daff',
+ 400: '#3399FF',
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 900: '#003A75',
+};
+
+const grey = {
+ 50: '#f6f8fa',
+ 100: '#eaeef2',
+ 200: '#d0d7de',
+ 300: '#afb8c1',
+ 400: '#8c959f',
+ 500: '#6e7781',
+ 600: '#57606a',
+ 700: '#424a53',
+ 800: '#32383f',
+ 900: '#24292f',
+};
+
+const StyledInputElement = styled('input')(
+ ({ theme }) => `
+ width: 320px;
+ font-family: IBM Plex Sans, sans-serif;
+ font-size: 0.875rem;
+ font-weight: 400;
+ line-height: 1.5;
+ padding: 8px 12px;
+ border-radius: 8px;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
+ background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
+ border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
+ box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
+
+ &:hover {
+ border-color: ${blue[400]};
+ }
+
+ &:focus {
+ border-color: ${blue[400]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
+`,
+);
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx
new file mode 100644
index 00000000000000..9bcd5bd37f4db8
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx
@@ -0,0 +1,66 @@
+import * as React from 'react';
+import { Input } from '@mui/base/Input';
+import { styled } from '@mui/system';
+
+const CustomInput = React.forwardRef(function CustomInput(
+ props: React.InputHTMLAttributes,
+ ref: React.ForwardedRef,
+) {
+ return ;
+});
+
+export default function UnstyledInputIntroduction() {
+ return ;
+}
+
+const blue = {
+ 100: '#DAECFF',
+ 200: '#b6daff',
+ 400: '#3399FF',
+ 500: '#007FFF',
+ 600: '#0072E5',
+ 900: '#003A75',
+};
+
+const grey = {
+ 50: '#f6f8fa',
+ 100: '#eaeef2',
+ 200: '#d0d7de',
+ 300: '#afb8c1',
+ 400: '#8c959f',
+ 500: '#6e7781',
+ 600: '#57606a',
+ 700: '#424a53',
+ 800: '#32383f',
+ 900: '#24292f',
+};
+
+const StyledInputElement = styled('input')(
+ ({ theme }) => `
+ width: 320px;
+ font-family: IBM Plex Sans, sans-serif;
+ font-size: 0.875rem;
+ font-weight: 400;
+ line-height: 1.5;
+ padding: 8px 12px;
+ border-radius: 8px;
+ color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
+ background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
+ border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
+ box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
+
+ &:hover {
+ border-color: ${blue[400]};
+ }
+
+ &:focus {
+ border-color: ${blue[400]};
+ box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]};
+ }
+
+ // firefox
+ &:focus-visible {
+ outline: 0;
+ }
+`,
+);
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction.tsx.preview b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx.preview
similarity index 100%
rename from docs/data/base/components/input/UnstyledInputIntroduction.tsx.preview
rename to docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx.preview
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js
new file mode 100644
index 00000000000000..863bce82d7ee99
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js
@@ -0,0 +1,60 @@
+import * as React from 'react';
+import PropTypes from 'prop-types';
+import { Input as BaseInput } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+import clsx from 'clsx';
+
+export default function UnstyledInputIntroduction() {
+ return ;
+}
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+const resolveSlotProps = (fn, args) => (typeof fn === 'function' ? fn(args) : fn);
+
+const Input = React.forwardRef((props, ref) => {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+ {
+ const resolvedSlotProps = resolveSlotProps(
+ props.slotProps?.input,
+ ownerState,
+ );
+ return {
+ ...resolvedSlotProps,
+ className: clsx(
+ 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0',
+ resolvedSlotProps?.className,
+ ),
+ };
+ },
+ }}
+ />
+ );
+});
+
+Input.propTypes = {
+ /**
+ * Class name applied to the root element.
+ */
+ className: PropTypes.string,
+ /**
+ * The props used for each slot inside the Input.
+ * @default {}
+ */
+ slotProps: PropTypes.shape({
+ input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
+ }),
+};
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx
new file mode 100644
index 00000000000000..521b5e2b822c6e
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx
@@ -0,0 +1,45 @@
+import * as React from 'react';
+import { Input as BaseInput, InputProps } from '@mui/base/Input';
+import { useTheme } from '@mui/system';
+import clsx from 'clsx';
+
+export default function UnstyledInputIntroduction() {
+ return ;
+}
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+const resolveSlotProps = (fn: any, args: any) =>
+ typeof fn === 'function' ? fn(args) : fn;
+
+const Input = React.forwardRef((props, ref) => {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+ {
+ const resolvedSlotProps = resolveSlotProps(
+ props.slotProps?.input,
+ ownerState,
+ );
+ return {
+ ...resolvedSlotProps,
+ className: clsx(
+ 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0',
+ resolvedSlotProps?.className,
+ ),
+ };
+ },
+ }}
+ />
+ );
+});
diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx.preview b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx.preview
new file mode 100644
index 00000000000000..12d25a9fa99b24
--- /dev/null
+++ b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx.preview
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/data/base/components/input/UseInput.js b/docs/data/base/components/input/UseInput.js
index bb5461650e1765..ef81f4af696f38 100644
--- a/docs/data/base/components/input/UseInput.js
+++ b/docs/data/base/components/input/UseInput.js
@@ -1,8 +1,27 @@
import * as React from 'react';
-import { useInput } from '@mui/base';
+import { useInput } from '@mui/base/useInput';
import { styled } from '@mui/system';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
+const CustomInput = React.forwardRef(function CustomInput(props, ref) {
+ const { getRootProps, getInputProps } = useInput(props);
+
+ const inputProps = getInputProps();
+
+ // Make sure that both the forwarded ref and the ref returned from the getInputProps are applied on the input element
+ inputProps.ref = useForkRef(inputProps.ref, ref);
+
+ return (
+
- );
-});
-
-export default function UseInput() {
- return ;
-}
diff --git a/docs/data/base/components/input/input-pt.md b/docs/data/base/components/input/input-pt.md
index 6f6b67e0dc4eca..7214f1abebd5d9 100644
--- a/docs/data/base/components/input/input-pt.md
+++ b/docs/data/base/components/input/input-pt.md
@@ -1,5 +1,5 @@
---
-product: base
+productId: base-ui
title: Unstyled React Input component and hook
components: InputUnstyled
githubLabel: 'component: input'
@@ -25,7 +25,7 @@ An input is a UI element that accepts text data from the user. The `InputUnstyle
### Usage
-After [installation](/base/getting-started/installation/), you can start building with this component using the following basic elements:
+After [installation](/base-ui/getting-started/quickstart/#installation), you can start building with this component using the following basic elements:
```jsx
import InputUnstyled from '@mui/base/InputUnstyled';
@@ -56,7 +56,7 @@ The `InputUnstyled` component is composed of a root `
` slot that houses one
### Slot props
:::info
-The following props are available on all non-utility Base components. See [Usage](/base/getting-started/usage/) for full details.
+The following props are available on all non-utility Base components. See [Usage](/base-ui/getting-started/usage/) for full details.
:::
Use the `component` prop to override the root slot with a custom element:
@@ -124,7 +124,7 @@ The `multiline` prop transforms the `` field into a `