(new Set([]));
-
- return (
-
-
-
Selected: {value}
-
- );
-}`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [value, setValue] = React.useState(new Set([]));
-
- return (
-
-
-
Selected: {value}
-
- );
-}`;
+import App from "./single-controlled.raw.jsx?raw";
+import AppTs from "./single-controlled.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
const reactTs = {
"/App.tsx": AppTs,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/sizes.raw.jsx b/apps/docs/content/components/select/sizes.raw.jsx
new file mode 100644
index 0000000000..afaeafc7a0
--- /dev/null
+++ b/apps/docs/content/components/select/sizes.raw.jsx
@@ -0,0 +1,45 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const animals = [
+ {key: "cat", label: "Cat"},
+ {key: "dog", label: "Dog"},
+ {key: "elephant", label: "Elephant"},
+ {key: "lion", label: "Lion"},
+ {key: "tiger", label: "Tiger"},
+ {key: "giraffe", label: "Giraffe"},
+ {key: "dolphin", label: "Dolphin"},
+ {key: "penguin", label: "Penguin"},
+ {key: "zebra", label: "Zebra"},
+ {key: "shark", label: "Shark"},
+ {key: "whale", label: "Whale"},
+ {key: "otter", label: "Otter"},
+ {key: "crocodile", label: "Crocodile"},
+];
+
+export default function App() {
+ const sizes = ["sm", "md", "lg"];
+
+ return (
+
+ {sizes.map((size) => (
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/sizes.ts b/apps/docs/content/components/select/sizes.ts
index 02b1cde2d0..85a2f5b30b 100644
--- a/apps/docs/content/components/select/sizes.ts
+++ b/apps/docs/content/components/select/sizes.ts
@@ -1,61 +1,7 @@
-const data = `export const animals = [
- {key: "cat", label: "Cat"},
- {key: "dog", label: "Dog"},
- {key: "elephant", label: "Elephant"},
- {key: "lion", label: "Lion"},
- {key: "tiger", label: "Tiger"},
- {key: "giraffe", label: "Giraffe"},
- {key: "dolphin", label: "Dolphin"},
- {key: "penguin", label: "Penguin"},
- {key: "zebra", label: "Zebra"},
- {key: "shark", label: "Shark"},
- {key: "whale", label: "Whale"},
- {key: "otter", label: "Otter"},
- {key: "crocodile", label: "Crocodile"}
-];`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const sizes = ["sm", "md", "lg"];
-
- return (
-
- {sizes.map((size) => (
-
-
-
-
- ))}
-
- );
-}`;
+import App from "./sizes.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/start-content.raw.jsx b/apps/docs/content/components/select/start-content.raw.jsx
new file mode 100644
index 0000000000..9164a68d79
--- /dev/null
+++ b/apps/docs/content/components/select/start-content.raw.jsx
@@ -0,0 +1,69 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const PetIcon = (props) => {
+ return (
+
+ );
+};
+
+export const animals = [
+ {key: "cat", label: "Cat"},
+ {key: "dog", label: "Dog"},
+ {key: "elephant", label: "Elephant"},
+ {key: "lion", label: "Lion"},
+ {key: "tiger", label: "Tiger"},
+ {key: "giraffe", label: "Giraffe"},
+ {key: "dolphin", label: "Dolphin"},
+ {key: "penguin", label: "Penguin"},
+ {key: "zebra", label: "Zebra"},
+ {key: "shark", label: "Shark"},
+ {key: "whale", label: "Whale"},
+ {key: "otter", label: "Otter"},
+ {key: "crocodile", label: "Crocodile"},
+];
+
+export default function App() {
+ return (
+ }
+ >
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/start-content.ts b/apps/docs/content/components/select/start-content.ts
index 7b896eaf3f..59191d72a7 100644
--- a/apps/docs/content/components/select/start-content.ts
+++ b/apps/docs/content/components/select/start-content.ts
@@ -1,78 +1,7 @@
-const data = `export const animals = [
- {key: "cat", label: "Cat"},
- {key: "dog", label: "Dog"},
- {key: "elephant", label: "Elephant"},
- {key: "lion", label: "Lion"},
- {key: "tiger", label: "Tiger"},
- {key: "giraffe", label: "Giraffe"},
- {key: "dolphin", label: "Dolphin"},
- {key: "penguin", label: "Penguin"},
- {key: "zebra", label: "Zebra"},
- {key: "shark", label: "Shark"},
- {key: "whale", label: "Whale"},
- {key: "otter", label: "Otter"},
- {key: "crocodile", label: "Crocodile"}
-];`;
-
-const PetIcon = `export const PetIcon = (props) => (
-
-);`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {PetIcon} from "./PetIcon";
-import {animals} from "./data";
-
-export default function App() {
- return (
- }
- >
- {animals.map((animal) => (
- {animal.label}
- ))}
-
- );
-}
-`;
+import App from "./start-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/PetIcon.jsx": PetIcon,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/usage.raw.jsx b/apps/docs/content/components/select/usage.raw.jsx
new file mode 100644
index 0000000000..1337231116
--- /dev/null
+++ b/apps/docs/content/components/select/usage.raw.jsx
@@ -0,0 +1,34 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const animals = [
+ {key: "cat", label: "Cat"},
+ {key: "dog", label: "Dog"},
+ {key: "elephant", label: "Elephant"},
+ {key: "lion", label: "Lion"},
+ {key: "tiger", label: "Tiger"},
+ {key: "giraffe", label: "Giraffe"},
+ {key: "dolphin", label: "Dolphin"},
+ {key: "penguin", label: "Penguin"},
+ {key: "zebra", label: "Zebra"},
+ {key: "shark", label: "Shark"},
+ {key: "whale", label: "Whale"},
+ {key: "otter", label: "Otter"},
+ {key: "crocodile", label: "Crocodile"},
+];
+
+export default function App() {
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/usage.ts b/apps/docs/content/components/select/usage.ts
index d676e3edb7..1118304c37 100644
--- a/apps/docs/content/components/select/usage.ts
+++ b/apps/docs/content/components/select/usage.ts
@@ -1,53 +1,7 @@
-const data = `export const animals = [
- {key: "cat", label: "Cat"},
- {key: "dog", label: "Dog"},
- {key: "elephant", label: "Elephant"},
- {key: "lion", label: "Lion"},
- {key: "tiger", label: "Tiger"},
- {key: "giraffe", label: "Giraffe"},
- {key: "dolphin", label: "Dolphin"},
- {key: "penguin", label: "Penguin"},
- {key: "zebra", label: "Zebra"},
- {key: "shark", label: "Shark"},
- {key: "whale", label: "Whale"},
- {key: "otter", label: "Otter"},
- {key: "crocodile", label: "Crocodile"}
-];`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- return (
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/variants.raw.jsx b/apps/docs/content/components/select/variants.raw.jsx
new file mode 100644
index 0000000000..78c5577ca7
--- /dev/null
+++ b/apps/docs/content/components/select/variants.raw.jsx
@@ -0,0 +1,45 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const animals = [
+ {key: "cat", label: "Cat"},
+ {key: "dog", label: "Dog"},
+ {key: "elephant", label: "Elephant"},
+ {key: "lion", label: "Lion"},
+ {key: "tiger", label: "Tiger"},
+ {key: "giraffe", label: "Giraffe"},
+ {key: "dolphin", label: "Dolphin"},
+ {key: "penguin", label: "Penguin"},
+ {key: "zebra", label: "Zebra"},
+ {key: "shark", label: "Shark"},
+ {key: "whale", label: "Whale"},
+ {key: "otter", label: "Otter"},
+ {key: "crocodile", label: "Crocodile"},
+];
+
+export default function App() {
+ const variants = ["flat", "bordered", "underlined", "faded"];
+
+ return (
+
+ {variants.map((variant) => (
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/variants.ts b/apps/docs/content/components/select/variants.ts
index 040be0e123..ddea95fb2e 100644
--- a/apps/docs/content/components/select/variants.ts
+++ b/apps/docs/content/components/select/variants.ts
@@ -1,61 +1,7 @@
-const data = `export const animals = [
- {key: "cat", label: "Cat"},
- {key: "dog", label: "Dog"},
- {key: "elephant", label: "Elephant"},
- {key: "lion", label: "Lion"},
- {key: "tiger", label: "Tiger"},
- {key: "giraffe", label: "Giraffe"},
- {key: "dolphin", label: "Dolphin"},
- {key: "penguin", label: "Penguin"},
- {key: "zebra", label: "Zebra"},
- {key: "shark", label: "Shark"},
- {key: "whale", label: "Whale"},
- {key: "otter", label: "Otter"},
- {key: "crocodile", label: "Crocodile"}
-];`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const variants = ["flat", "bordered", "underlined", "faded"];
-
- return (
-
- {variants.map((variant) => (
-
-
-
-
- ))}
-
- );
-}`;
+import App from "./variants.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/without-scroll-shadow.raw.jsx b/apps/docs/content/components/select/without-scroll-shadow.raw.jsx
new file mode 100644
index 0000000000..3aab534e2b
--- /dev/null
+++ b/apps/docs/content/components/select/without-scroll-shadow.raw.jsx
@@ -0,0 +1,35 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const animals = [
+ {key: "cat", label: "Cat"},
+ {key: "dog", label: "Dog"},
+ {key: "elephant", label: "Elephant"},
+ {key: "lion", label: "Lion"},
+ {key: "tiger", label: "Tiger"},
+ {key: "giraffe", label: "Giraffe"},
+ {key: "dolphin", label: "Dolphin"},
+ {key: "penguin", label: "Penguin"},
+ {key: "zebra", label: "Zebra"},
+ {key: "shark", label: "Shark"},
+ {key: "whale", label: "Whale"},
+ {key: "otter", label: "Otter"},
+ {key: "crocodile", label: "Crocodile"},
+];
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/select/without-scroll-shadow.ts b/apps/docs/content/components/select/without-scroll-shadow.ts
index 7a4d8b585d..1cfe3080fa 100644
--- a/apps/docs/content/components/select/without-scroll-shadow.ts
+++ b/apps/docs/content/components/select/without-scroll-shadow.ts
@@ -1,45 +1,7 @@
-const data = `export const animals = [
- {key: "cat", label: "Cat"},
- {key: "dog", label: "Dog"},
- {key: "elephant", label: "Elephant"},
- {key: "lion", label: "Lion"},
- {key: "tiger", label: "Tiger"},
- {key: "giraffe", label: "Giraffe"},
- {key: "dolphin", label: "Dolphin"},
- {key: "penguin", label: "Penguin"},
- {key: "zebra", label: "Zebra"},
- {key: "shark", label: "Shark"},
- {key: "whale", label: "Whale"},
- {key: "otter", label: "Otter"},
- {key: "crocodile", label: "Crocodile"}
-];`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./without-scroll-shadow.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/docs/components/select.mdx b/apps/docs/content/docs/components/select.mdx
index 0469b09cab..55b476c101 100644
--- a/apps/docs/content/docs/components/select.mdx
+++ b/apps/docs/content/docs/components/select.mdx
@@ -54,7 +54,7 @@ Select follows the [Collection Components API](https://react-spectrum.adobe.com/
- **Static**: The usage example above shows the static implementation, which can be used when the full list of options is known ahead of time.
- **Dynamic**: The example below can be used when the options come from an external data source such as an API call, or update over time.
-
+
### Multiple Selection
@@ -64,24 +64,24 @@ You can use the `selectionMode="multiple"` property to allow multiple selection.
### Disabled
-
+
### Disabled Items
You can disable specific items by using the `disabledKeys` property.
-
+
### Required
If you pass the `isRequired` property to the select, it will have a `danger` asterisk at
the end of the label and the select will be required.
-
+
### Sizes
-
+
### Colors
@@ -99,7 +99,7 @@ the end of the label and the select will be required.
You can change the position of the label by setting the `labelPlacement` property to `inside`, `outside` or `outside-left`.
-
+
> **Note**: If the `label` is not passed, the `labelPlacement` property will be `outside` by default.
@@ -108,7 +108,7 @@ You can change the position of the label by setting the `labelPlacement` propert
You can use the `startContent` and `endContent` properties to add content to the start and end of
the select.
-
+
### Item Start & End Content