({
+ className: `list-none p-2 rounded-lg cursor-default last-of-type:border-b-0 ${getOptionColorClasses(
+ { selected, highlighted, disabled },
+ )}`,
+ }),
+ }}
+ />
+ );
+});
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+export default function UnstyledSelectBasic() {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+
+
+ );
+}
diff --git a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx
new file mode 100644
index 00000000000000..68f90a9a5f92d6
--- /dev/null
+++ b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx
@@ -0,0 +1,77 @@
+import * as React from 'react';
+import Select from '@mui/base/Select';
+import BaseOption, { OptionProps, OptionOwnerState } from '@mui/base/Option';
+import { useTheme } from '@mui/system';
+
+const getOptionColorClasses = ({
+ selected,
+ highlighted,
+ disabled,
+}: Partial>) => {
+ let classes = '';
+ if (disabled) {
+ classes += 'text-slate-400 dark:text-slate-700';
+ } else {
+ if (selected) {
+ classes +=
+ ' bg-purple-100 dark:bg-purple-950 text-purple-950 dark:text-purple-50';
+ } else if (highlighted) {
+ classes +=
+ ' bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-slate-300';
+ }
+ classes +=
+ ' hover:dark:bg-slate-800 hover:bg-slate-100 hover:dark:text-slate-300 hover:text-slate-900';
+ }
+ return classes;
+};
+
+const Option = React.forwardRef>((props, ref) => {
+ return (
+ ({
+ className: `list-none p-2 rounded-lg cursor-default last-of-type:border-b-0 ${getOptionColorClasses(
+ { selected, highlighted, disabled },
+ )}`,
+ }),
+ }}
+ />
+ );
+});
+
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+export default function UnstyledSelectBasic() {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+
+
+ );
+}
diff --git a/docs/data/base/components/select/UnstyledSelectSimple.tsx.preview b/docs/data/base/components/select/UnstyledSelectSimple.tsx.preview
deleted file mode 100644
index d2b6f081a69b69..00000000000000
--- a/docs/data/base/components/select/UnstyledSelectSimple.tsx.preview
+++ /dev/null
@@ -1,5 +0,0 @@
-
- Ten
- Twenty
- Thirty
-
\ No newline at end of file
diff --git a/docs/data/base/components/select/select.md b/docs/data/base/components/select/select.md
index db24c408cef6a5..36edd240a630fc 100644
--- a/docs/data/base/components/select/select.md
+++ b/docs/data/base/components/select/select.md
@@ -54,7 +54,7 @@ export default function MyApp() {
The following demo shows how to create and style a Select component.
-{{"demo": "UnstyledSelectSimple.js", "defaultCodeOpen": false}}
+{{"demo": "UnstyledSelectBasic", "defaultCodeOpen": false}}
#### Form submission