diff --git a/src/sections/Projects/Sistent/components/select/code-block.js b/src/sections/Projects/Sistent/components/select/code-block.js
new file mode 100644
index 000000000000..2a7463d6ceec
--- /dev/null
+++ b/src/sections/Projects/Sistent/components/select/code-block.js
@@ -0,0 +1,20 @@
+import React, { useState } from "react";
+import Code from "../../../../../components/CodeBlock";
+
+export const CodeBlock = ({ name, code }) => {
+ const [showCode, setShowCode] = useState(false);
+ const onChange = () => {
+ setShowCode((prev) => !prev);
+ };
+ return (
+
+
+
+ Show Code
+
+ {showCode && (
+
+ )}
+
+ );
+};
diff --git a/src/sections/Projects/Sistent/components/select/code.js b/src/sections/Projects/Sistent/components/select/code.js
index 2fe492150816..c4c9ec608b9e 100644
--- a/src/sections/Projects/Sistent/components/select/code.js
+++ b/src/sections/Projects/Sistent/components/select/code.js
@@ -1,14 +1,21 @@
import React from "react";
-import { Button, SistentThemeProvider } from "@layer5/sistent";
+import { SistentThemeProvider } from "@layer5/sistent";
import { CodeBlock } from "./code-block";
-import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
import { SistentLayout } from "../../sistent-layout";
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import SectionNav from "./section-nav";
import Header from "./header";
-import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";
+import {
+ FormControl,
+ FormHelperText,
+ InputLabel,
+ ListSubheader,
+ MenuItem,
+ OutlinedInput,
+ Select,
+} from "@mui/material";
const codes = {
"variant-outlined": `
@@ -85,11 +92,88 @@ const codes = {
`,
+
+ "customize-label": `
+
+ Age
+
+ Ten
+ Twenty
+ Thirty
+
+
+ `,
+ "customize-helper-text": `
+
+
+ Ten
+ Twenty
+ Thirty
+
+ This is a helper text
+
+ `,
+
+ "customize-placeholder": `const [selectedAge, setSelectedAge] = React.useState("");
+
+
+ setSelectedAge(e.target.value)}
+ renderValue={() => {
+ if (selectedAge == "") return Select an age ;
+ return selectedAge;
+ }}
+ value={selectedAge}
+ displayEmpty
+ >
+ Ten
+ Twenty
+ Thirty
+
+ `,
+
+ "customize-grouping": `
+ Group 1
+ Ten
+ Twenty
+ Group 2
+ Thirty
+ Fourty
+ Group 3
+ Fifty
+ Sixty
+ `,
+
+ multiselect: `const [multipleAges, setMultipleAges] = React.useState([]);
+const handleMultiplSelect = (event) => {
+ let agesList = event.target.value;
+ setMultipleAges(agesList);
+};
+
+ }
+ value={multipleAges}
+ onChange={handleMultiplSelect}
+ >
+ Ten
+ Twenty
+ Thirty
+
+ `,
};
-const ButtonCode = () => {
+const SelectCode = () => {
const { isDark } = useStyledDarkMode();
-
+ const [selectedAge, setSelectedAge] = React.useState("");
+ const [multipleAges, setMultipleAges] = React.useState([10]);
+ const handleMultiplSelect = (event) => {
+ let agesList = event.target.value;
+ setMultipleAges(agesList);
+ };
return (
@@ -210,9 +294,108 @@ const ButtonCode = () => {
-
- Customize behaviors
+
+ Customization
+ Label
+
+ To add a label to the select component, wrap it inside a FormControl
+ component. Add an InputLabel component and link it to the select
+ component using the labelId prop. Ensure the label prop in the
+ Select component matches the InputLabel text.
+
+
+
+
+
+ Age
+
+ Ten
+ Twenty
+ Thirty
+
+
+
+
+
+
+ Helper text
+
+
+
+
+
+ Ten
+ Twenty
+ Thirty
+
+ This is a helper text
+
+
+
+
+
+ Placeholder
+
+ To add a placeholder, use the renderValue prop to display a
+ placeholder text when no value is selected.
+
+
+
+
+ setSelectedAge(e.target.value)}
+ renderValue={() => {
+ if (selectedAge == "") return Select an age ;
+ return selectedAge;
+ }}
+ value={selectedAge}
+ displayEmpty
+ >
+ Ten
+ Twenty
+ Thirty
+
+
+
+
+
+ Grouping
+ To group selection options, use the ListSubheader component to create
+ headers for each group within the dropdown menu. This helps users to
+ easily navigate and find the options they need.
+
+
+
+
+ Group 1
+ Ten
+ Twenty
+ Group 2
+ Thirty
+ Fourty
+ Group 3
+ Fifty
+ Sixty
+
+
+
+
+
Additional props such as error, required, and disabled can be passed
to the select component to customize its behavior.
@@ -265,13 +448,30 @@ const ButtonCode = () => {
clarity.
-
- Customize select area
+
+ Multi-select
+
+
+
+ }
+ value={multipleAges}
+ onChange={handleMultiplSelect}
+ >
+ Ten
+ Twenty
+ Thirty
+
+
+
+
+
);
};
-export default ButtonCode;
+export default SelectCode;
diff --git a/src/sections/Projects/Sistent/components/select/guidance.js b/src/sections/Projects/Sistent/components/select/guidance.js
index 763c841dd183..24adf0c502c9 100644
--- a/src/sections/Projects/Sistent/components/select/guidance.js
+++ b/src/sections/Projects/Sistent/components/select/guidance.js
@@ -153,7 +153,11 @@ const SelectGuidance = () => {
Placeholder
- Placeholder can be used to give more context about the selection.
+ A placeholder is a short hint or description that is displayed
+ inside an input field or select component before the user enters a
+ value. It provides a clue to the user about what kind of information
+ is expected in the field. The placeholder text disappears when the
+ user starts typing or selects an option.