(today(getLocalTimeZone()));
-
- let {locale} = useLocale();
-
- let now = today(getLocalTimeZone());
- let nextMonth = now.add({months: 1});
-
- let nextWeek = {
- start: startOfWeek(now.add({weeks: 1}), locale),
- end: endOfWeek(now.add({weeks: 1}), locale),
- };
- let thisMonth = {start: startOfMonth(now), end: endOfMonth(now)};
- let nextMonthValue = {start: startOfMonth(nextMonth), end: endOfMonth(nextMonth)};
-
-
- const CustomRadio = (props) => {
- const {children, ...otherProps} = props;
-
- return (
-
- {children}
-
- );
- };
-
- return (
-
-
- Exact dates
- 1 day
- 2 days
- 3 days
- 7 days
- 14 days
-
- }
- focusedValue={focusedValue}
- nextButtonProps={{
- variant: "bordered",
- }}
- prevButtonProps={{
- variant: "bordered",
- }}
- topContent={
-
- {
- setValue(nextWeek);
- setFocusedValue(nextWeek.end);
- }}
- >
- Next week
-
- {
- setValue(thisMonth);
- setFocusedValue(thisMonth.start);
- }}
- >
- This month
-
- {
- setValue(nextMonthValue), setFocusedValue(nextMonthValue.start);
- }}
- >
- Next month
-
-
- }
- value={value}
- onChange={setValue}
- onFocusChange={setFocusedValue}
- />
-
- );
-}`;
+import App from "./presets.raw.jsx?raw";
+import AppTs from "./presets.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/range-calendar/read-only.raw.jsx b/apps/docs/content/components/range-calendar/read-only.raw.jsx
new file mode 100644
index 0000000000..3a6ba6e3fd
--- /dev/null
+++ b/apps/docs/content/components/range-calendar/read-only.raw.jsx
@@ -0,0 +1,15 @@
+import {RangeCalendar} from "@nextui-org/react";
+import {today, getLocalTimeZone} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/range-calendar/read-only.ts b/apps/docs/content/components/range-calendar/read-only.ts
index 1badad0004..caf4be10cf 100644
--- a/apps/docs/content/components/range-calendar/read-only.ts
+++ b/apps/docs/content/components/range-calendar/read-only.ts
@@ -1,18 +1,4 @@
-const App = `import {RangeCalendar} from "@nextui-org/react";
-import {today, getLocalTimeZone} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./read-only.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/range-calendar/unavailable-dates.raw.jsx b/apps/docs/content/components/range-calendar/unavailable-dates.raw.jsx
new file mode 100644
index 0000000000..3803115132
--- /dev/null
+++ b/apps/docs/content/components/range-calendar/unavailable-dates.raw.jsx
@@ -0,0 +1,23 @@
+import {RangeCalendar} from "@nextui-org/react";
+import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
+import {useLocale} from "@react-aria/i18n";
+
+export default function App() {
+ let now = today(getLocalTimeZone());
+
+ let disabledRanges = [
+ [now, now.add({days: 5})],
+ [now.add({days: 14}), now.add({days: 16})],
+ [now.add({days: 23}), now.add({days: 24})],
+ ];
+
+ let {locale} = useLocale();
+
+ let isDateUnavailable = (date) =>
+ isWeekend(date, locale) ||
+ disabledRanges.some(
+ (interval) => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0,
+ );
+
+ return ;
+}
diff --git a/apps/docs/content/components/range-calendar/unavailable-dates.ts b/apps/docs/content/components/range-calendar/unavailable-dates.ts
index 6d656ff8f3..b4e1f4df1a 100644
--- a/apps/docs/content/components/range-calendar/unavailable-dates.ts
+++ b/apps/docs/content/components/range-calendar/unavailable-dates.ts
@@ -1,32 +1,4 @@
-const App = `import {RangeCalendar} from "@nextui-org/react";
-import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
-import {useLocale} from "@react-aria/i18n";
-
-
-export default function App() {
- let now = today(getLocalTimeZone());
-
- let disabledRanges = [
- [now, now.add({days: 5})],
- [now.add({days: 14}), now.add({days: 16})],
- [now.add({days: 23}), now.add({days: 24})],
- ];
-
- let {locale} = useLocale();
-
- let isDateUnavailable = (date) =>
- isWeekend(date, locale) ||
- disabledRanges.some(
- (interval) => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0,
- );
-
- return (
-
- );
-}`;
+import App from "./unavailable-dates.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/range-calendar/usage.raw.jsx b/apps/docs/content/components/range-calendar/usage.raw.jsx
new file mode 100644
index 0000000000..1e81856a24
--- /dev/null
+++ b/apps/docs/content/components/range-calendar/usage.raw.jsx
@@ -0,0 +1,17 @@
+import {RangeCalendar} from "@nextui-org/react";
+import {today, getLocalTimeZone} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/range-calendar/usage.ts b/apps/docs/content/components/range-calendar/usage.ts
index 7cbaeec6e0..1118304c37 100644
--- a/apps/docs/content/components/range-calendar/usage.ts
+++ b/apps/docs/content/components/range-calendar/usage.ts
@@ -1,20 +1,4 @@
-const App = `import {RangeCalendar} from "@nextui-org/react";
-import {today, getLocalTimeZone} from '@internationalized/date';
-
-export default function App() {
- return (
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/range-calendar/visible-months.raw.jsx b/apps/docs/content/components/range-calendar/visible-months.raw.jsx
new file mode 100644
index 0000000000..bbefbd53e6
--- /dev/null
+++ b/apps/docs/content/components/range-calendar/visible-months.raw.jsx
@@ -0,0 +1,5 @@
+import {RangeCalendar} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/range-calendar/visible-months.ts b/apps/docs/content/components/range-calendar/visible-months.ts
index a669107921..38c2db8f01 100644
--- a/apps/docs/content/components/range-calendar/visible-months.ts
+++ b/apps/docs/content/components/range-calendar/visible-months.ts
@@ -1,13 +1,4 @@
-const App = `import {RangeCalendar} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./visible-months.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/range-calendar/with-month-and-year-picker.raw.jsx b/apps/docs/content/components/range-calendar/with-month-and-year-picker.raw.jsx
new file mode 100644
index 0000000000..98e50fce5e
--- /dev/null
+++ b/apps/docs/content/components/range-calendar/with-month-and-year-picker.raw.jsx
@@ -0,0 +1,5 @@
+import {RangeCalendar} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/range-calendar/with-month-and-year-picker.ts b/apps/docs/content/components/range-calendar/with-month-and-year-picker.ts
index 05581f78a1..53df2d1367 100644
--- a/apps/docs/content/components/range-calendar/with-month-and-year-picker.ts
+++ b/apps/docs/content/components/range-calendar/with-month-and-year-picker.ts
@@ -1,13 +1,4 @@
-const App = `import {RangeCalendar} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./with-month-and-year-picker.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/scroll-shadow/custom-size.raw.jsx b/apps/docs/content/components/scroll-shadow/custom-size.raw.jsx
new file mode 100644
index 0000000000..d31e069dd5
--- /dev/null
+++ b/apps/docs/content/components/scroll-shadow/custom-size.raw.jsx
@@ -0,0 +1,74 @@
+import {ScrollShadow} from "@nextui-org/react";
+
+export const Content = () => (
+
+
+ Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id
+ consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim
+ nostrud elit officia tempor esse quis.
+
+
+ Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor
+ cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum
+ quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit
+ incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa
+ deserunt nostrud ad veniam.
+
+
+ Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea
+ laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat.
+ Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et
+ ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
+
+
+ Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud
+ laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident
+ fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex.
+ Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit
+ quis aute in elit magna ullamco in consequat ex proident.
+
+
+ Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat
+ velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing
+ tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi
+ do ullamco in quis elit.
+
+
+ Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud
+ pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation
+ cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor
+ consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua
+ deserunt cupidatat consequat id.
+
+
+ Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor
+ incididunt aliquip minim elit ea. Exercitation non officia eu id.
+
+
+ Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem.
+ Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam.
+ Officia duis ea sunt aliqua.
+
+
+ Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut
+ dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea
+ et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum
+ dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
+
+
+ Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut.
+ Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat
+ eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam
+ cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id
+ voluptate.
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/scroll-shadow/custom-size.ts b/apps/docs/content/components/scroll-shadow/custom-size.ts
index 5df7bfd1c5..bdac09246a 100644
--- a/apps/docs/content/components/scroll-shadow/custom-size.ts
+++ b/apps/docs/content/components/scroll-shadow/custom-size.ts
@@ -1,52 +1,7 @@
-const Content = `export const Content = () => (
-
-
- Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis.
-
-
- Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
-
-
- Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat. Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
-
-
- Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex. Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit quis aute in elit magna ullamco in consequat ex proident.
-
-
- Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi do ullamco in quis elit.
-
-
- Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua deserunt cupidatat consequat id.
-
-
- Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor incididunt aliquip minim elit ea. Exercitation non officia eu id.
-
-
- Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem. Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam. Officia duis ea sunt aliqua.
-
-
- Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
-
-
- Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut. Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id voluptate.
-
-
-);`;
-
-const App = `import {ScrollShadow} from "@nextui-org/react";
-import {Content} from "./Content";
-
-export default function App() {
- return (
-
-
-
- );
-}`;
+import App from "./custom-size.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/Content.jsx": Content,
};
export default {
diff --git a/apps/docs/content/components/scroll-shadow/hide-scrollbar.raw.jsx b/apps/docs/content/components/scroll-shadow/hide-scrollbar.raw.jsx
new file mode 100644
index 0000000000..9f2fdf5ba2
--- /dev/null
+++ b/apps/docs/content/components/scroll-shadow/hide-scrollbar.raw.jsx
@@ -0,0 +1,74 @@
+import {ScrollShadow} from "@nextui-org/react";
+
+export const Content = () => (
+
+
+ Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id
+ consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim
+ nostrud elit officia tempor esse quis.
+
+
+ Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor
+ cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum
+ quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit
+ incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa
+ deserunt nostrud ad veniam.
+
+
+ Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea
+ laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat.
+ Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et
+ ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
+
+
+ Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud
+ laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident
+ fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex.
+ Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit
+ quis aute in elit magna ullamco in consequat ex proident.
+
+
+ Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat
+ velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing
+ tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi
+ do ullamco in quis elit.
+
+
+ Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud
+ pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation
+ cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor
+ consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua
+ deserunt cupidatat consequat id.
+
+
+ Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor
+ incididunt aliquip minim elit ea. Exercitation non officia eu id.
+
+
+ Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem.
+ Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam.
+ Officia duis ea sunt aliqua.
+
+
+ Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut
+ dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea
+ et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum
+ dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
+
+
+ Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut.
+ Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat
+ eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam
+ cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id
+ voluptate.
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/scroll-shadow/hide-scrollbar.ts b/apps/docs/content/components/scroll-shadow/hide-scrollbar.ts
index 74e82bc299..c431601bc5 100644
--- a/apps/docs/content/components/scroll-shadow/hide-scrollbar.ts
+++ b/apps/docs/content/components/scroll-shadow/hide-scrollbar.ts
@@ -1,52 +1,7 @@
-const Content = `export const Content = () => (
-
-
- Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis.
-
-
- Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
-
-
- Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat. Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
-
-
- Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex. Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit quis aute in elit magna ullamco in consequat ex proident.
-
-
- Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi do ullamco in quis elit.
-
-
- Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua deserunt cupidatat consequat id.
-
-
- Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor incididunt aliquip minim elit ea. Exercitation non officia eu id.
-
-
- Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem. Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam. Officia duis ea sunt aliqua.
-
-
- Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
-
-
- Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut. Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id voluptate.
-
-
-);`;
-
-const App = `import {ScrollShadow} from "@nextui-org/react";
-import {Content} from "./Content";
-
-export default function App() {
- return (
-
-
-
- );
-}`;
+import App from "./hide-scrollbar.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/Content.jsx": Content,
};
export default {
diff --git a/apps/docs/content/components/scroll-shadow/horizontal.raw.jsx b/apps/docs/content/components/scroll-shadow/horizontal.raw.jsx
new file mode 100644
index 0000000000..4da067924e
--- /dev/null
+++ b/apps/docs/content/components/scroll-shadow/horizontal.raw.jsx
@@ -0,0 +1,74 @@
+import {ScrollShadow} from "@nextui-org/react";
+
+export const Content = () => (
+
+
+ Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id
+ consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim
+ nostrud elit officia tempor esse quis.
+
+
+ Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor
+ cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum
+ quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit
+ incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa
+ deserunt nostrud ad veniam.
+
+
+ Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea
+ laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat.
+ Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et
+ ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
+
+
+ Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud
+ laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident
+ fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex.
+ Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit
+ quis aute in elit magna ullamco in consequat ex proident.
+
+
+ Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat
+ velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing
+ tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi
+ do ullamco in quis elit.
+
+
+ Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud
+ pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation
+ cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor
+ consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua
+ deserunt cupidatat consequat id.
+
+
+ Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor
+ incididunt aliquip minim elit ea. Exercitation non officia eu id.
+
+
+ Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem.
+ Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam.
+ Officia duis ea sunt aliqua.
+
+
+ Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut
+ dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea
+ et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum
+ dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
+
+
+ Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut.
+ Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat
+ eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam
+ cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id
+ voluptate.
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/scroll-shadow/horizontal.ts b/apps/docs/content/components/scroll-shadow/horizontal.ts
index a9a1d87cd3..60be4b4077 100644
--- a/apps/docs/content/components/scroll-shadow/horizontal.ts
+++ b/apps/docs/content/components/scroll-shadow/horizontal.ts
@@ -1,52 +1,7 @@
-const Content = `export const Content = ({className}) => (
-
-
- Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis.
-
-
- Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
-
-
- Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat. Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
-
-
- Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex. Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit quis aute in elit magna ullamco in consequat ex proident.
-
-
- Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi do ullamco in quis elit.
-
-
- Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua deserunt cupidatat consequat id.
-
-
- Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor incididunt aliquip minim elit ea. Exercitation non officia eu id.
-
-
- Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem. Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam. Officia duis ea sunt aliqua.
-
-
- Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
-
-
- Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut. Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id voluptate.
-
-
-);`;
-
-const App = `import {ScrollShadow} from "@nextui-org/react";
-import {Content} from "./Content";
-
-export default function App() {
- return (
-
-
-
- );
-}`;
+import App from "./horizontal.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/Content.jsx": Content,
};
export default {
diff --git a/apps/docs/content/components/scroll-shadow/offset.raw.jsx b/apps/docs/content/components/scroll-shadow/offset.raw.jsx
new file mode 100644
index 0000000000..e5a237b0e7
--- /dev/null
+++ b/apps/docs/content/components/scroll-shadow/offset.raw.jsx
@@ -0,0 +1,79 @@
+import {ScrollShadow} from "@nextui-org/react";
+
+export const Content = () => (
+
+
+ Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id
+ consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim
+ nostrud elit officia tempor esse quis.
+
+
+ Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor
+ cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum
+ quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit
+ incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa
+ deserunt nostrud ad veniam.
+
+
+ Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea
+ laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat.
+ Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et
+ ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
+
+
+ Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud
+ laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident
+ fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex.
+ Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit
+ quis aute in elit magna ullamco in consequat ex proident.
+
+
+ Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat
+ velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing
+ tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi
+ do ullamco in quis elit.
+
+
+ Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud
+ pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation
+ cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor
+ consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua
+ deserunt cupidatat consequat id.
+
+
+ Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor
+ incididunt aliquip minim elit ea. Exercitation non officia eu id.
+
+
+ Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem.
+ Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam.
+ Officia duis ea sunt aliqua.
+
+
+ Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut
+ dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea
+ et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum
+ dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
+
+
+ Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut.
+ Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat
+ eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam
+ cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id
+ voluptate.
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/scroll-shadow/offset.ts b/apps/docs/content/components/scroll-shadow/offset.ts
index 9980333ad5..2fb601047c 100644
--- a/apps/docs/content/components/scroll-shadow/offset.ts
+++ b/apps/docs/content/components/scroll-shadow/offset.ts
@@ -1,57 +1,7 @@
-const Content = `export const Content = ({className}) => (
-
-
- Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis.
-
-
- Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
-
-
- Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat. Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
-
-
- Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex. Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit quis aute in elit magna ullamco in consequat ex proident.
-
-
- Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi do ullamco in quis elit.
-
-
- Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua deserunt cupidatat consequat id.
-
-
- Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor incididunt aliquip minim elit ea. Exercitation non officia eu id.
-
-
- Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem. Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam. Officia duis ea sunt aliqua.
-
-
- Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
-
-
- Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut. Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id voluptate.
-
-
-);`;
-
-const App = `import {ScrollShadow} from "@nextui-org/react";
-import {Content} from "./Content";
-
-export default function App() {
- return (
-
-
-
- );
-}`;
+import App from "./offset.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/Content.jsx": Content,
};
export default {
diff --git a/apps/docs/content/components/scroll-shadow/usage.raw.jsx b/apps/docs/content/components/scroll-shadow/usage.raw.jsx
new file mode 100644
index 0000000000..12f96b5ff0
--- /dev/null
+++ b/apps/docs/content/components/scroll-shadow/usage.raw.jsx
@@ -0,0 +1,74 @@
+import {ScrollShadow} from "@nextui-org/react";
+
+export const Content = () => (
+
+
+ Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id
+ consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim
+ nostrud elit officia tempor esse quis.
+
+
+ Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor
+ cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum
+ quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit
+ incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa
+ deserunt nostrud ad veniam.
+
+
+ Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea
+ laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat.
+ Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et
+ ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
+
+
+ Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud
+ laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident
+ fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex.
+ Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit
+ quis aute in elit magna ullamco in consequat ex proident.
+
+
+ Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat
+ velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing
+ tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi
+ do ullamco in quis elit.
+
+
+ Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud
+ pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation
+ cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor
+ consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua
+ deserunt cupidatat consequat id.
+
+
+ Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor
+ incididunt aliquip minim elit ea. Exercitation non officia eu id.
+
+
+ Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem.
+ Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam.
+ Officia duis ea sunt aliqua.
+
+
+ Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut
+ dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea
+ et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum
+ dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
+
+
+ Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut.
+ Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat
+ eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam
+ cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id
+ voluptate.
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/scroll-shadow/usage.ts b/apps/docs/content/components/scroll-shadow/usage.ts
index 5c911e8a84..1118304c37 100644
--- a/apps/docs/content/components/scroll-shadow/usage.ts
+++ b/apps/docs/content/components/scroll-shadow/usage.ts
@@ -1,52 +1,7 @@
-const Content = `export const Content = () => (
-
-
- Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis.
-
-
- Sunt ad dolore quis aute consequat. Magna exercitation reprehenderit magna aute tempor cupidatat consequat elit dolor adipisicing. Mollit dolor eiusmod sunt ex incididunt cillum quis. Velit duis sit officia eiusmod Lorem aliqua enim laboris do dolor eiusmod. Et mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident Lorem eiusmod et. Culpa deserunt nostrud ad veniam.
-
-
- Est velit labore esse esse cupidatat. Velit id elit consequat minim. Mollit enim excepteur ea laboris adipisicing aliqua proident occaecat do do adipisicing adipisicing ut fugiat. Consequat pariatur ullamco aute sunt esse. Irure excepteur eu non eiusmod. Commodo commodo et ad ipsum elit esse pariatur sit adipisicing sunt excepteur enim.
-
-
- Incididunt duis commodo mollit esse veniam non exercitation dolore occaecat ea nostrud laboris. Adipisicing occaecat fugiat fugiat irure fugiat in magna non consectetur proident fugiat. Commodo magna et aliqua elit sint cupidatat. Sint aute ullamco enim cillum anim ex. Est eiusmod commodo occaecat consequat laboris est do duis. Enim incididunt non culpa velit quis aute in elit magna ullamco in consequat ex proident.
-
-
- Dolore incididunt mollit fugiat pariatur cupidatat ipsum laborum cillum. Commodo consequat velit cupidatat duis ex nisi non aliquip ad ea pariatur do culpa. Eiusmod proident adipisicing tempor tempor qui pariatur voluptate dolor do ea commodo. Veniam voluptate cupidatat ex nisi do ullamco in quis elit.
-
-
- Cillum proident veniam cupidatat pariatur laborum tempor cupidatat anim eiusmod id nostrud pariatur tempor reprehenderit. Do esse ullamco laboris sunt proident est ea exercitation cupidatat. Do Lorem eiusmod aliqua culpa ullamco consectetur veniam voluptate cillum. Dolor consequat cillum tempor laboris mollit laborum reprehenderit reprehenderit veniam aliqua deserunt cupidatat consequat id.
-
-
- Est id tempor excepteur enim labore sint aliquip consequat duis minim tempor proident. Dolor incididunt aliquip minim elit ea. Exercitation non officia eu id.
-
-
- Ipsum ipsum consequat incididunt do aliquip pariatur nostrud. Qui ut sint culpa labore Lorem. Magna deserunt aliquip aute duis consectetur magna amet anim. Magna fugiat est nostrud veniam. Officia duis ea sunt aliqua.
-
-
- Ipsum minim officia aute anim minim aute aliquip aute non in non. Ipsum aliquip proident ut dolore eiusmod ad fugiat fugiat ut ex. Ea velit Lorem ut et commodo nulla voluptate veniam ea et aliqua esse id. Pariatur dolor et adipisicing ea mollit. Ipsum non irure proident ipsum dolore aliquip adipisicing laborum irure dolor nostrud occaecat exercitation.
-
-
- Culpa qui reprehenderit nostrud aliqua reprehenderit et ullamco proident nisi commodo non ut. Ipsum quis irure nisi sint do qui velit nisi. Sunt voluptate eu reprehenderit tempor consequat eiusmod Lorem irure velit duis Lorem laboris ipsum cupidatat. Pariatur excepteur tempor veniam cillum et nulla ipsum veniam ad ipsum ad aute. Est officia duis pariatur ad eiusmod id voluptate.
-
-
-);`;
-
-const App = `import {ScrollShadow} from "@nextui-org/react";
-import {Content} from "./Content";
-
-export default function App() {
- return (
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/Content.jsx": Content,
};
export default {
diff --git a/apps/docs/content/components/select/async-loading-items.raw.jsx b/apps/docs/content/components/select/async-loading-items.raw.jsx
new file mode 100644
index 0000000000..9e6e7713b8
--- /dev/null
+++ b/apps/docs/content/components/select/async-loading-items.raw.jsx
@@ -0,0 +1,98 @@
+import {Select, SelectItem} from "@nextui-org/react";
+import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
+
+export function usePokemonList({fetchDelay = 0} = {}) {
+ const [items, setItems] = React.useState([]);
+ const [hasMore, setHasMore] = React.useState(true);
+ const [isLoading, setIsLoading] = React.useState(false);
+ const [offset, setOffset] = React.useState(0);
+ const limit = 10; // Number of items per page, adjust as necessary
+
+ const loadPokemon = async (currentOffset) => {
+ const controller = new AbortController();
+ const {signal} = controller;
+
+ try {
+ setIsLoading(true);
+
+ if (offset > 0) {
+ // Delay to simulate network latency
+ await new Promise((resolve) => setTimeout(resolve, fetchDelay));
+ }
+
+ let res = await fetch(
+ `https://pokeapi.co/api/v2/pokemon?offset=${currentOffset}&limit=${limit}`,
+ {signal},
+ );
+
+ if (!res.ok) {
+ throw new Error("Network response was not ok");
+ }
+
+ let json = await res.json();
+
+ setHasMore(json.next !== null);
+ // Append new results to existing ones
+ setItems((prevItems) => [...prevItems, ...json.results]);
+ } catch (error) {
+ if (error.name === "AbortError") {
+ // eslint-disable-next-line no-console
+ console.log("Fetch aborted");
+ } else {
+ // eslint-disable-next-line no-console
+ console.error("There was an error with the fetch operation:", error);
+ }
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ React.useEffect(() => {
+ loadPokemon(offset);
+ }, []);
+
+ const onLoadMore = () => {
+ const newOffset = offset + limit;
+
+ setOffset(newOffset);
+ loadPokemon(newOffset);
+ };
+
+ return {
+ items,
+ hasMore,
+ isLoading,
+ onLoadMore,
+ };
+}
+
+export default function App() {
+ const [isOpen, setIsOpen] = React.useState(false);
+ const {items, hasMore, isLoading, onLoadMore} = usePokemonList({fetchDelay: 1500});
+
+ const [, scrollerRef] = useInfiniteScroll({
+ hasMore,
+ isEnabled: isOpen,
+ shouldUseLoader: false, // We don't want to show the loader at the bottom of the list
+ onLoadMore,
+ });
+
+ return (
+
+ {(item) => (
+
+ {item.name}
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/async-loading-items.raw.tsx b/apps/docs/content/components/select/async-loading-items.raw.tsx
new file mode 100644
index 0000000000..9d27a59662
--- /dev/null
+++ b/apps/docs/content/components/select/async-loading-items.raw.tsx
@@ -0,0 +1,109 @@
+import React from "react";
+import {Select, SelectItem} from "@nextui-org/react";
+import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
+
+export type Pokemon = {
+ name: string;
+ url: string;
+};
+
+export type UsePokemonListProps = {
+ /** Delay to wait before fetching more items */
+ fetchDelay?: number;
+};
+
+export function usePokemonList({fetchDelay = 0}: UsePokemonListProps = {}) {
+ const [items, setItems] = React.useState([]);
+ const [hasMore, setHasMore] = React.useState(true);
+ const [isLoading, setIsLoading] = React.useState(false);
+ const [offset, setOffset] = React.useState(0);
+ const limit = 10; // Number of items per page, adjust as necessary
+
+ const loadPokemon = async (currentOffset: number) => {
+ const controller = new AbortController();
+ const {signal} = controller;
+
+ try {
+ setIsLoading(true);
+
+ if (offset > 0) {
+ // Delay to simulate network latency
+ await new Promise((resolve) => setTimeout(resolve, fetchDelay));
+ }
+
+ let res = await fetch(
+ `https://pokeapi.co/api/v2/pokemon?offset=${currentOffset}&limit=${limit}`,
+ {signal},
+ );
+
+ if (!res.ok) {
+ throw new Error("Network response was not ok");
+ }
+
+ let json = await res.json();
+
+ setHasMore(json.next !== null);
+ // Append new results to existing ones
+ setItems((prevItems) => [...prevItems, ...json.results]);
+ } catch (error) {
+ // @ts-ignore
+ if (error.name === "AbortError") {
+ // eslint-disable-next-line no-console
+ console.log("Fetch aborted");
+ } else {
+ // eslint-disable-next-line no-console
+ console.error("There was an error with the fetch operation:", error);
+ }
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ React.useEffect(() => {
+ loadPokemon(offset);
+ }, []);
+
+ const onLoadMore = () => {
+ const newOffset = offset + limit;
+
+ setOffset(newOffset);
+ loadPokemon(newOffset);
+ };
+
+ return {
+ items,
+ hasMore,
+ isLoading,
+ onLoadMore,
+ };
+}
+export default function App() {
+ const [isOpen, setIsOpen] = React.useState(false);
+ const {items, hasMore, isLoading, onLoadMore} = usePokemonList({fetchDelay: 1500});
+
+ const [, scrollerRef] = useInfiniteScroll({
+ hasMore,
+ isEnabled: isOpen,
+ shouldUseLoader: false, // We don't want to show the loader at the bottom of the list
+ onLoadMore,
+ });
+
+ return (
+
+ {(item) => (
+
+ {item.name}
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/async-loading-items.ts b/apps/docs/content/components/select/async-loading-items.ts
index c6de820cab..a69188c565 100644
--- a/apps/docs/content/components/select/async-loading-items.ts
+++ b/apps/docs/content/components/select/async-loading-items.ts
@@ -1,184 +1,12 @@
-const usePokemonListTs = `export type Pokemon = {
- name: string;
- url: string;
-};
-
-export type UsePokemonListProps = {
- /** Delay to wait before fetching more items */
- fetchDelay?: number;
-};
-
-export function usePokemonList({fetchDelay = 0}: UsePokemonListProps = {}) {
- const [items, setItems] = React.useState([]);
- const [hasMore, setHasMore] = React.useState(true);
- const [isLoading, setIsLoading] = React.useState(false);
- const [offset, setOffset] = React.useState(0);
- const limit = 10; // Number of items per page, adjust as necessary
-
- const loadPokemon = async (currentOffset: number) => {
- const controller = new AbortController();
- const {signal} = controller;
-
- try {
- setIsLoading(true);
-
- if (offset > 0) {
- // Delay to simulate network latency
- await new Promise((resolve) => setTimeout(resolve, fetchDelay));
- }
-
- let res = await fetch(
- \`https://pokeapi.co/api/v2/pokemon?offset=\${currentOffset}&limit=\${limit}\`,
- {signal},
- );
-
- if (!res.ok) {
- throw new Error("Network response was not ok");
- }
-
- let json = await res.json();
-
- setHasMore(json.next !== null);
- // Append new results to existing ones
- setItems((prevItems) => [...prevItems, ...json.results]);
- } catch (error) {
- if (error.name === "AbortError") {
- console.log("Fetch aborted");
- } else {
- console.error("There was an error with the fetch operation:", error);
- }
- } finally {
- setIsLoading(false);
- }
- };
-
- React.useEffect(() => {
- loadPokemon(offset);
- }, []);
-
- const onLoadMore = () => {
- const newOffset = offset + limit;
-
- setOffset(newOffset);
- loadPokemon(newOffset);
- };
-
- return {
- items,
- hasMore,
- isLoading,
- onLoadMore,
- };
-}
-
-`;
-
-const usePokemonList = `export function usePokemonList({fetchDelay = 0} = {}) {
- const [items, setItems] = React.useState([]);
- const [hasMore, setHasMore] = React.useState(true);
- const [isLoading, setIsLoading] = React.useState(false);
- const [offset, setOffset] = React.useState(0);
- const limit = 10; // Number of items per page, adjust as necessary
-
- const loadPokemon = async (currentOffset) => {
- const controller = new AbortController();
- const {signal} = controller;
-
- try {
- setIsLoading(true);
-
- if (offset > 0) {
- // Delay to simulate network latency
- await new Promise((resolve) => setTimeout(resolve, fetchDelay));
- }
-
- let res = await fetch(
- \`https://pokeapi.co/api/v2/pokemon?offset=\${currentOffset}&limit=\${limit}\`,
- {signal},
- );
-
- if (!res.ok) {
- throw new Error("Network response was not ok");
- }
-
- let json = await res.json();
-
- setHasMore(json.next !== null);
- // Append new results to existing ones
- setItems((prevItems) => [...prevItems, ...json.results]);
- } catch (error) {
- if (error.name === "AbortError") {
- console.log("Fetch aborted");
- } else {
- console.error("There was an error with the fetch operation:", error);
- }
- } finally {
- setIsLoading(false);
- }
- };
-
- React.useEffect(() => {
- loadPokemon(offset);
- }, []);
-
- const onLoadMore = () => {
- const newOffset = offset + limit;
-
- setOffset(newOffset);
- loadPokemon(newOffset);
- };
-
- return {
- items,
- hasMore,
- isLoading,
- onLoadMore,
- };
-};`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
-import {usePokemonList} from "./usePokemonList";
-
-export default function App() {
- const [isOpen, setIsOpen] = React.useState(false);
- const {items, hasMore, isLoading, onLoadMore} = usePokemonList({fetchDelay: 1500});
-
- const [, scrollerRef] = useInfiniteScroll({
- hasMore,
- isEnabled: isOpen,
- shouldUseLoader: false, // We don't want to show the loader at the bottom of the list
- onLoadMore,
- });
-
- return (
-
- {(item) => (
-
- {item.name}
-
- )}
-
- );
-}`;
+import App from "./async-loading-items.raw.jsx?raw";
+import AppTs from "./async-loading-items.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/usePokemonList.js": usePokemonList,
};
const reactTs = {
- "/App.tsx": App,
- "/usePokemonList.ts": usePokemonListTs,
+ "/App.tsx": AppTs,
};
export default {
diff --git a/apps/docs/content/components/select/colors.raw.jsx b/apps/docs/content/components/select/colors.raw.jsx
new file mode 100644
index 0000000000..1732747ba5
--- /dev/null
+++ b/apps/docs/content/components/select/colors.raw.jsx
@@ -0,0 +1,40 @@
+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 colors = ["default", "primary", "secondary", "success", "warning", "danger"];
+
+ return (
+
+ {colors.map((color) => (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/colors.ts b/apps/docs/content/components/select/colors.ts
index c830262ca1..d5bef810aa 100644
--- a/apps/docs/content/components/select/colors.ts
+++ b/apps/docs/content/components/select/colors.ts
@@ -1,57 +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 colors = [
- "default",
- "primary",
- "secondary",
- "success",
- "warning",
- "danger",
- ];
-
- return (
-
- {colors.map((color) => (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- ))}
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/custom-items.raw.jsx b/apps/docs/content/components/select/custom-items.raw.jsx
new file mode 100644
index 0000000000..b1b78c716a
--- /dev/null
+++ b/apps/docs/content/components/select/custom-items.raw.jsx
@@ -0,0 +1,228 @@
+import {Select, SelectItem, Avatar} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export default function App() {
+ return (
+
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/custom-items.ts b/apps/docs/content/components/select/custom-items.ts
index 66f7d96dd7..26a1e0f9ac 100644
--- a/apps/docs/content/components/select/custom-items.ts
+++ b/apps/docs/content/components/select/custom-items.ts
@@ -1,236 +1,7 @@
-const data = `export const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
- email: "mia.robinson@example.com",
- },
-];`;
-
-const App = `import {Select, SelectItem, Avatar} from "@nextui-org/react";
-import {users} from "./data";
-
-export default function App() {
- return (
-
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
+import App from "./custom-items.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/custom-render-value.raw.jsx b/apps/docs/content/components/select/custom-render-value.raw.jsx
new file mode 100644
index 0000000000..c038d4d13a
--- /dev/null
+++ b/apps/docs/content/components/select/custom-render-value.raw.jsx
@@ -0,0 +1,247 @@
+import {Select, SelectItem, Avatar} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export default function App() {
+ return (
+ {
+ return items.map((item) => (
+
+
+
+ {item.data.name}
+ ({item.data.email})
+
+
+ ));
+ }}
+ >
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/custom-render-value.raw.tsx b/apps/docs/content/components/select/custom-render-value.raw.tsx
new file mode 100644
index 0000000000..5c2c71f9fb
--- /dev/null
+++ b/apps/docs/content/components/select/custom-render-value.raw.tsx
@@ -0,0 +1,259 @@
+import React from "react";
+import {Select, SelectItem, Avatar, SelectedItems} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+type User = {
+ id: number;
+ name: string;
+ role: string;
+ team: string;
+ status: string;
+ age: string;
+ avatar: string;
+ email: string;
+};
+
+export default function App() {
+ return (
+ ) => {
+ return items.map((item) => (
+
+
+
+ {item.data?.name}
+ ({item.data?.email})
+
+
+ ));
+ }}
+ >
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/custom-render-value.ts b/apps/docs/content/components/select/custom-render-value.ts
index dc52e11211..3d16320688 100644
--- a/apps/docs/content/components/select/custom-render-value.ts
+++ b/apps/docs/content/components/select/custom-render-value.ts
@@ -1,317 +1,12 @@
-const data = `export const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
- email: "mia.robinson@example.com",
- },
-];`;
-
-const App = `import {Select, SelectItem, Avatar} from "@nextui-org/react";
-import {users} from "./data";
-
-export default function App() {
- return (
- {
- return items.map((item) => (
-
-
-
- {item.data.name}
- ({item.data.email})
-
-
- ));
- }}
- >
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
-
-const AppTs = `import {Select, SelectItem, Avatar, SelectedItems} from "@nextui-org/react";
-import {users} from "./data";
-
-type User = {
- id: number;
- name: string;
- role: string;
- team: string;
- status: string;
- age: string;
- avatar: string;
- email: string;
-};
-
-export default function App() {
- return (
- ) => {
- return items.map((item) => (
-
-
-
- {item.data.name}
- ({item.data.email})
-
-
- ));
- }}
- >
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
+import App from "./custom-render-value.raw.jsx?raw";
+import AppTs from "./custom-render-value.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
const reactTs = {
"/App.tsx": AppTs,
- "/data.ts": data,
};
export default {
diff --git a/apps/docs/content/components/select/custom-sections-style.raw.jsx b/apps/docs/content/components/select/custom-sections-style.raw.jsx
new file mode 100644
index 0000000000..17826ba15c
--- /dev/null
+++ b/apps/docs/content/components/select/custom-sections-style.raw.jsx
@@ -0,0 +1,48 @@
+import {Select, SelectItem, SelectSection} from "@nextui-org/react";
+
+export default function App() {
+ const headingClasses =
+ "flex w-full sticky top-1 z-20 py-1.5 px-2 bg-default-100 shadow-small rounded-small";
+
+ return (
+
+
+ Lion
+ Tiger
+ Elephant
+ Kangaroo
+ Panda
+ Giraffe
+ Zebra
+ Cheetah
+
+
+ Eagle
+ Parrot
+ Penguin
+ Ostrich
+ Peacock
+ Swan
+ Falcon
+ Flamingo
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/custom-sections-style.ts b/apps/docs/content/components/select/custom-sections-style.ts
index 9551a80049..9ba8a6cd9c 100644
--- a/apps/docs/content/components/select/custom-sections-style.ts
+++ b/apps/docs/content/components/select/custom-sections-style.ts
@@ -1,50 +1,4 @@
-const App = `import {Select, SelectItem, SelectSection} from "@nextui-org/react";
-
-export default function App() {
- const headingClasses = "flex w-full sticky top-1 z-20 py-1.5 px-2 bg-default-100 shadow-small rounded-small";
-
- return (
-
-
- Lion
- Tiger
- Elephant
- Kangaroo
- Panda
- Giraffe
- Zebra
- Cheetah
-
-
- Eagle
- Parrot
- Penguin
- Ostrich
- Peacock
- Swan
- Falcon
- Flamingo
-
-
- );
-}`;
+import App from "./custom-sections-style.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/select/custom-selector-icon.raw.jsx b/apps/docs/content/components/select/custom-selector-icon.raw.jsx
new file mode 100644
index 0000000000..f63192b0b5
--- /dev/null
+++ b/apps/docs/content/components/select/custom-selector-icon.raw.jsx
@@ -0,0 +1,57 @@
+import {Select, SelectItem} from "@nextui-org/react";
+
+export const SelectorIcon = (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/custom-selector-icon.ts b/apps/docs/content/components/select/custom-selector-icon.ts
index 18770cfb44..ee2c7d9a8b 100644
--- a/apps/docs/content/components/select/custom-selector-icon.ts
+++ b/apps/docs/content/components/select/custom-selector-icon.ts
@@ -1,67 +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 SelectorIcon = `export const SelectorIcon = (props) => (
-
-
-
-
-
-);`;
-
-const App = `import {Select, SelectItem} from "@nextui-org/react";
-import {SelectorIcon} from "./SelectorIcon";
-import {animals} from "./data";
-
-export default function App() {
- return (
- }
- >
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./custom-selector-icon.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
- "/SelectorIcon.jsx": SelectorIcon,
};
export default {
diff --git a/apps/docs/content/components/select/custom-styles.raw.jsx b/apps/docs/content/components/select/custom-styles.raw.jsx
new file mode 100644
index 0000000000..6aad7b60dc
--- /dev/null
+++ b/apps/docs/content/components/select/custom-styles.raw.jsx
@@ -0,0 +1,269 @@
+import {Select, SelectItem, Avatar} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export default function App() {
+ return (
+ {
+ return items.map((item) => (
+
+
+
+ {item.data.name}
+ ({item.data.email})
+
+
+ ));
+ }}
+ variant="bordered"
+ >
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/custom-styles.ts b/apps/docs/content/components/select/custom-styles.ts
index ae2db45e8a..da3ea9093a 100644
--- a/apps/docs/content/components/select/custom-styles.ts
+++ b/apps/docs/content/components/select/custom-styles.ts
@@ -1,277 +1,7 @@
-const data = `export const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
- email: "mia.robinson@example.com",
- },
-];`;
-
-const App = `import {Select, SelectItem, Avatar} from "@nextui-org/react";
-import {users} from "./data";
-
-export default function App() {
- return (
- {
- return items.map((item) => (
-
-
-
- {item.data.name}
- ({item.data.email})
-
-
- ));
- }}
- >
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/description.raw.jsx b/apps/docs/content/components/select/description.raw.jsx
new file mode 100644
index 0000000000..ead30aaa95
--- /dev/null
+++ b/apps/docs/content/components/select/description.raw.jsx
@@ -0,0 +1,33 @@
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/description.ts b/apps/docs/content/components/select/description.ts
index b39c36847d..aeb6340b6b 100644
--- a/apps/docs/content/components/select/description.ts
+++ b/apps/docs/content/components/select/description.ts
@@ -1,43 +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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./description.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/disabled-items.raw.jsx b/apps/docs/content/components/select/disabled-items.raw.jsx
new file mode 100644
index 0000000000..fcebedbb83
--- /dev/null
+++ b/apps/docs/content/components/select/disabled-items.raw.jsx
@@ -0,0 +1,32 @@
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/disabled-items.ts b/apps/docs/content/components/select/disabled-items.ts
index 64bed55e89..4ff907eed2 100644
--- a/apps/docs/content/components/select/disabled-items.ts
+++ b/apps/docs/content/components/select/disabled-items.ts
@@ -1,42 +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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./disabled-items.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/disabled.raw.jsx b/apps/docs/content/components/select/disabled.raw.jsx
new file mode 100644
index 0000000000..401ae52a4d
--- /dev/null
+++ b/apps/docs/content/components/select/disabled.raw.jsx
@@ -0,0 +1,33 @@
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/disabled.ts b/apps/docs/content/components/select/disabled.ts
index dc9b756812..1a215cc91f 100644
--- a/apps/docs/content/components/select/disabled.ts
+++ b/apps/docs/content/components/select/disabled.ts
@@ -1,43 +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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./disabled.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/dynamic.raw.jsx b/apps/docs/content/components/select/dynamic.raw.jsx
new file mode 100644
index 0000000000..5796f069eb
--- /dev/null
+++ b/apps/docs/content/components/select/dynamic.raw.jsx
@@ -0,0 +1,30 @@
+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 (
+
+ {(animal) => {animal.label} }
+
+ );
+}
diff --git a/apps/docs/content/components/select/dynamic.ts b/apps/docs/content/components/select/dynamic.ts
index 6a7c5304c9..5d3c97bb9a 100644
--- a/apps/docs/content/components/select/dynamic.ts
+++ b/apps/docs/content/components/select/dynamic.ts
@@ -1,38 +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 (
-
- {(animal) => {animal.label} }
-
- );
-}`;
+import App from "./dynamic.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/error-message.raw.jsx b/apps/docs/content/components/select/error-message.raw.jsx
new file mode 100644
index 0000000000..a4499144e7
--- /dev/null
+++ b/apps/docs/content/components/select/error-message.raw.jsx
@@ -0,0 +1,43 @@
+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 [value, setValue] = React.useState(new Set([]));
+ const [touched, setTouched] = React.useState(false);
+
+ const isValid = value.has("cat");
+
+ return (
+ setTouched(true)}
+ onSelectionChange={setValue}
+ >
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/error-message.ts b/apps/docs/content/components/select/error-message.ts
index 416a1d49bb..fb8101b132 100644
--- a/apps/docs/content/components/select/error-message.ts
+++ b/apps/docs/content/components/select/error-message.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() {
- const [value, setValue] = React.useState(new Set([]));
- const [touched, setTouched] = React.useState(false);
-
- const isValid = value.has("cat");
-
- return (
- setTouched(true)}
- >
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./error-message.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/item-start-content.raw.jsx b/apps/docs/content/components/select/item-start-content.raw.jsx
new file mode 100644
index 0000000000..9006a2bf1b
--- /dev/null
+++ b/apps/docs/content/components/select/item-start-content.raw.jsx
@@ -0,0 +1,68 @@
+import {Select, SelectItem, Avatar} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ }
+ >
+ Argentina
+
+
+ }
+ >
+ Venezuela
+
+ }
+ >
+ Brazil
+
+
+ }
+ >
+ Switzerland
+
+ }
+ >
+ Germany
+
+ }
+ >
+ Spain
+
+ }
+ >
+ France
+
+ }
+ >
+ Italy
+
+ }
+ >
+ Mexico
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/item-start-content.ts b/apps/docs/content/components/select/item-start-content.ts
index ddf3818b25..294a22e6b2 100644
--- a/apps/docs/content/components/select/item-start-content.ts
+++ b/apps/docs/content/components/select/item-start-content.ts
@@ -1,70 +1,4 @@
-const App = `import {Select, SelectItem, Avatar} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- }
- >
- Argentina
-
- }
- >
- Venezuela
-
- }
- >
- Brazil
-
-
- }
- >
- Switzerland
-
- }
- >
- Germany
-
- }
- >
- Spain
-
- }
- >
- France
-
- }
- >
- Italy
-
- }
- >
- Mexico
-
-
- );
-}`;
+import App from "./item-start-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/select/label-placements.raw.jsx b/apps/docs/content/components/select/label-placements.raw.jsx
new file mode 100644
index 0000000000..86982bafb1
--- /dev/null
+++ b/apps/docs/content/components/select/label-placements.raw.jsx
@@ -0,0 +1,61 @@
+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 placements = ["inside", "outside", "outside-left"];
+
+ return (
+
+
+
Without placeholder
+
+ {placements.map((placement) => (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ ))}
+
+
+
+
With placeholder
+
+ {placements.map((placement) => (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ ))}
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/label-placements.ts b/apps/docs/content/components/select/label-placements.ts
index a147bb84a7..cd2a65d352 100644
--- a/apps/docs/content/components/select/label-placements.ts
+++ b/apps/docs/content/components/select/label-placements.ts
@@ -1,75 +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 placements = [
- "inside",
- "outside",
- "outside-left",
- ];
-
- return (
-
-
-
Without placeholder
-
- {placements.map((placement) => (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- ))}
-
-
-
-
With placeholder
-
- {placements.map((placement) => (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- ))}
-
-
-
- );
-}`;
+import App from "./label-placements.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/multiple-chips.raw.jsx b/apps/docs/content/components/select/multiple-chips.raw.jsx
new file mode 100644
index 0000000000..3c0dd44cad
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-chips.raw.jsx
@@ -0,0 +1,243 @@
+import {Select, SelectItem, Avatar, Chip} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export default function App() {
+ return (
+ {
+ return (
+
+ {items.map((item) => (
+ {item.data.name}
+ ))}
+
+ );
+ }}
+ selectionMode="multiple"
+ variant="bordered"
+ >
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-chips.raw.tsx b/apps/docs/content/components/select/multiple-chips.raw.tsx
new file mode 100644
index 0000000000..18f206aed9
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-chips.raw.tsx
@@ -0,0 +1,255 @@
+import React from "react";
+import {Select, SelectItem, Avatar, Chip, SelectedItems} from "@nextui-org/react";
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
+ email: "mia.robinson@example.com",
+ },
+];
+
+type User = {
+ id: number;
+ name: string;
+ role: string;
+ team: string;
+ status: string;
+ age: string;
+ avatar: string;
+ email: string;
+};
+
+export default function App() {
+ return (
+ ) => {
+ return (
+
+ {items.map((item) => (
+ {item.data?.name}
+ ))}
+
+ );
+ }}
+ selectionMode="multiple"
+ variant="bordered"
+ >
+ {(user) => (
+
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+ )}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-chips.ts b/apps/docs/content/components/select/multiple-chips.ts
index 1919c994ea..0c169cde37 100644
--- a/apps/docs/content/components/select/multiple-chips.ts
+++ b/apps/docs/content/components/select/multiple-chips.ts
@@ -1,309 +1,12 @@
-const data = `export const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/1.png",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/1.png",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/2.png",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/2.png",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/3.png",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/3.png",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/4.png",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/4.png",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/5.png",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/5.png",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/7.png",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/7.png",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/8.png",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/8.png",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/9.png",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/9.png",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/11.png",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/11.png",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/male/12.png",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://d2u8k2ocievbld.cloudfront.net/memojis/female/12.png",
- email: "mia.robinson@example.com",
- },
-];`;
-
-const App = `import {Select, SelectItem, Avatar, Chip} from "@nextui-org/react";
-import {users} from "./data";
-
-export default function App() {
- return (
- {
- return (
-
- {items.map((item) => (
- {item.data.name}
- ))}
-
- );
- }}
- >
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
-
-const AppTs = `import {Select, SelectItem, Avatar, Chip, SelectedItems} from "@nextui-org/react";
-import {users} from "./data";
-
-type User = {
- id: number;
- name: string;
- role: string;
- team: string;
- status: string;
- age: string;
- avatar: string;
- email: string;
-};
-
-export default function App() {
- return (
- ) => {
- return (
-
- {items.map((item) => (
- {item.data.name}
- ))}
-
- );
- }}
- >
- {(user) => (
-
-
-
-
- {user.name}
- {user.email}
-
-
-
- )}
-
- );
-}`;
+import App from "./multiple-chips.raw.jsx?raw";
+import AppTs from "./multiple-chips.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/multiple-controlled-onchange.raw.jsx b/apps/docs/content/components/select/multiple-controlled-onchange.raw.jsx
new file mode 100644
index 0000000000..1b79957568
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-controlled-onchange.raw.jsx
@@ -0,0 +1,43 @@
+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 [values, setValues] = React.useState(new Set([]));
+
+ const handleSelectionChange = (e) => {
+ setValues(new Set(e.target.value.split(",")));
+ };
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {Array.from(values).join(", ")}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-controlled-onchange.raw.tsx b/apps/docs/content/components/select/multiple-controlled-onchange.raw.tsx
new file mode 100644
index 0000000000..d171292536
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-controlled-onchange.raw.tsx
@@ -0,0 +1,46 @@
+import type {Selection} from "@nextui-org/react";
+
+import React from "react";
+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 [values, setValues] = React.useState(new Set([]));
+
+ const handleSelectionChange = (e: React.ChangeEvent) => {
+ setValues(new Set(e.target.value.split(",")));
+ };
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {Array.from(values).join(", ")}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-controlled-onchange.ts b/apps/docs/content/components/select/multiple-controlled-onchange.ts
index e12d5cf7d3..a8b2a21759 100644
--- a/apps/docs/content/components/select/multiple-controlled-onchange.ts
+++ b/apps/docs/content/components/select/multiple-controlled-onchange.ts
@@ -1,89 +1,12 @@
-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 [values, setValues] = React.useState(new Set([]));
-
- const handleSelectionChange = (e) => {
- setValues(new Set(e.target.value.split(",")));
- };
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {Array.from(values).join(", ")}
-
- );
-}`;
-
-const AppTs = `import {Select, SelectItem, Selection} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [values, setValues] = React.useState(new Set([]));
-
- const handleSelectionChange = (e: React.ChangeEvent) => {
- setValues(new Set(e.target.value.split(",")));
- };
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {Array.from(values).join(", ")}
-
- );
-}`;
+import App from "./multiple-controlled-onchange.raw.jsx?raw";
+import AppTs from "./multiple-controlled-onchange.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
const reactTs = {
"/App.tsx": AppTs,
- "/data.ts": data,
};
export default {
diff --git a/apps/docs/content/components/select/multiple-controlled.raw.jsx b/apps/docs/content/components/select/multiple-controlled.raw.jsx
new file mode 100644
index 0000000000..0d18ab0e6e
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-controlled.raw.jsx
@@ -0,0 +1,39 @@
+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 [values, setValues] = React.useState(new Set(["cat", "dog"]));
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {Array.from(values).join(", ")}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-controlled.raw.tsx b/apps/docs/content/components/select/multiple-controlled.raw.tsx
new file mode 100644
index 0000000000..c9b9d3f8bf
--- /dev/null
+++ b/apps/docs/content/components/select/multiple-controlled.raw.tsx
@@ -0,0 +1,42 @@
+import type {Selection} from "@nextui-org/react";
+
+import React from "react";
+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 [values, setValues] = React.useState(new Set(["cat", "dog"]));
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {Array.from(values).join(", ")}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple-controlled.ts b/apps/docs/content/components/select/multiple-controlled.ts
index 2bfc63c6c7..ebc28a01db 100644
--- a/apps/docs/content/components/select/multiple-controlled.ts
+++ b/apps/docs/content/components/select/multiple-controlled.ts
@@ -1,81 +1,12 @@
-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 [values, setValues] = React.useState(new Set(["cat", "dog"]));
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {Array.from(values).join(", ")}
-
- );
-}`;
-
-const AppTs = `import {Select, SelectItem, Selection} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [values, setValues] = React.useState(new Set(["cat", "dog"]));
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {Array.from(values).join(", ")}
-
- );
-}`;
+import App from "./multiple-controlled.raw.jsx?raw";
+import AppTs from "./multiple-controlled.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
const reactTs = {
"/App.tsx": AppTs,
- "/data.ts": data,
};
export default {
diff --git a/apps/docs/content/components/select/multiple.raw.jsx b/apps/docs/content/components/select/multiple.raw.jsx
new file mode 100644
index 0000000000..71bf4b1465
--- /dev/null
+++ b/apps/docs/content/components/select/multiple.raw.jsx
@@ -0,0 +1,32 @@
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/multiple.ts b/apps/docs/content/components/select/multiple.ts
index 5edb2da50f..8ad090fa27 100644
--- a/apps/docs/content/components/select/multiple.ts
+++ b/apps/docs/content/components/select/multiple.ts
@@ -1,42 +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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./multiple.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/open-state.raw.jsx b/apps/docs/content/components/select/open-state.raw.jsx
new file mode 100644
index 0000000000..bd553f9d07
--- /dev/null
+++ b/apps/docs/content/components/select/open-state.raw.jsx
@@ -0,0 +1,41 @@
+import {Select, SelectItem, Button} 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 [isOpen, setIsOpen] = React.useState(false);
+
+ return (
+
+ open !== isOpen && setIsOpen(open)}
+ >
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ setIsOpen(!isOpen)}>
+ {isOpen ? "Close" : "Open"}
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/open-state.ts b/apps/docs/content/components/select/open-state.ts
index 97e13a99a7..5d40fb0bf0 100644
--- a/apps/docs/content/components/select/open-state.ts
+++ b/apps/docs/content/components/select/open-state.ts
@@ -1,51 +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, Button} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [isOpen, setIsOpen] = React.useState(false);
-
- return (
-
- open !== isOpen && setIsOpen(open)}
- className="max-w-xs"
- >
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- setIsOpen(!isOpen)}>
- {isOpen ? "Close" : "Open"}
-
-
- );
-}`;
+import App from "./open-state.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/radius.raw.jsx b/apps/docs/content/components/select/radius.raw.jsx
new file mode 100644
index 0000000000..9375e69cb6
--- /dev/null
+++ b/apps/docs/content/components/select/radius.raw.jsx
@@ -0,0 +1,40 @@
+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 radius = ["full", "lg", "md", "sm", "none"];
+
+ return (
+
+ {radius.map((r) => (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/radius.ts b/apps/docs/content/components/select/radius.ts
index 543c0c91df..7b78db1ce0 100644
--- a/apps/docs/content/components/select/radius.ts
+++ b/apps/docs/content/components/select/radius.ts
@@ -1,56 +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 radius = [
- "full",
- "lg",
- "md",
- "sm",
- "none",
- ];
-
- return (
-
- {radius.map((r) => (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- ))}
-
- );
-}`;
+import App from "./radius.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/required.raw.jsx b/apps/docs/content/components/select/required.raw.jsx
new file mode 100644
index 0000000000..9a9f4f0cbd
--- /dev/null
+++ b/apps/docs/content/components/select/required.raw.jsx
@@ -0,0 +1,33 @@
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/select/required.ts b/apps/docs/content/components/select/required.ts
index f6447eba53..b50b781e6f 100644
--- a/apps/docs/content/components/select/required.ts
+++ b/apps/docs/content/components/select/required.ts
@@ -1,43 +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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+import App from "./required.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/select/sections.raw.jsx b/apps/docs/content/components/select/sections.raw.jsx
new file mode 100644
index 0000000000..30a61aa009
--- /dev/null
+++ b/apps/docs/content/components/select/sections.raw.jsx
@@ -0,0 +1,28 @@
+import {Select, SelectItem, SelectSection} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ Lion
+ Tiger
+ Elephant
+ Kangaroo
+ Panda
+ Giraffe
+ Zebra
+ Cheetah
+
+
+ Eagle
+ Parrot
+ Penguin
+ Ostrich
+ Peacock
+ Swan
+ Falcon
+ Flamingo
+
+
+ );
+}
diff --git a/apps/docs/content/components/select/sections.ts b/apps/docs/content/components/select/sections.ts
index e1c02ebdb4..17cd360ea3 100644
--- a/apps/docs/content/components/select/sections.ts
+++ b/apps/docs/content/components/select/sections.ts
@@ -1,35 +1,4 @@
-const App = `import {Select, SelectItem, SelectSection} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- Lion
- Tiger
- Elephant
- Kangaroo
- Panda
- Giraffe
- Zebra
- Cheetah
-
-
- Eagle
- Parrot
- Penguin
- Ostrich
- Peacock
- Swan
- Falcon
- Flamingo
-
-
- );
-}`;
+import App from "./sections.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/select/single-controlled-onchange.raw.jsx b/apps/docs/content/components/select/single-controlled-onchange.raw.jsx
new file mode 100644
index 0000000000..43b41a4e27
--- /dev/null
+++ b/apps/docs/content/components/select/single-controlled-onchange.raw.jsx
@@ -0,0 +1,43 @@
+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 [value, setValue] = React.useState("");
+
+ const handleSelectionChange = (e) => {
+ setValue(e.target.value);
+ };
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/select/single-controlled-onchange.raw.tsx b/apps/docs/content/components/select/single-controlled-onchange.raw.tsx
new file mode 100644
index 0000000000..c5199449ce
--- /dev/null
+++ b/apps/docs/content/components/select/single-controlled-onchange.raw.tsx
@@ -0,0 +1,44 @@
+import React from "react";
+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 [value, setValue] = React.useState("");
+
+ const handleSelectionChange = (e: React.ChangeEvent) => {
+ setValue(e.target.value);
+ };
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/select/single-controlled-onchange.ts b/apps/docs/content/components/select/single-controlled-onchange.ts
index b74254621a..3b52be133b 100644
--- a/apps/docs/content/components/select/single-controlled-onchange.ts
+++ b/apps/docs/content/components/select/single-controlled-onchange.ts
@@ -1,89 +1,12 @@
-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 [value, setValue] = React.useState("");
-
- const handleSelectionChange = (e) => {
- setValue(e.target.value);
- };
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {value}
-
- );
-}`;
-
-const AppTs = `import {Select, SelectItem} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [value, setValue] = React.useState("");
-
- const handleSelectionChange = (e: React.ChangeEvent) => {
- setValue(e.target.value);
- };
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
Selected: {value}
-
- );
-}`;
+import App from "./single-controlled-onchange.raw.jsx?raw";
+import AppTs from "./single-controlled-onchange.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/single-controlled.raw.jsx b/apps/docs/content/components/select/single-controlled.raw.jsx
new file mode 100644
index 0000000000..a066013863
--- /dev/null
+++ b/apps/docs/content/components/select/single-controlled.raw.jsx
@@ -0,0 +1,39 @@
+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 [value, setValue] = React.useState(new Set([]));
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/select/single-controlled.raw.tsx b/apps/docs/content/components/select/single-controlled.raw.tsx
new file mode 100644
index 0000000000..13a1a847c0
--- /dev/null
+++ b/apps/docs/content/components/select/single-controlled.raw.tsx
@@ -0,0 +1,42 @@
+import type {Selection} from "@nextui-org/react";
+
+import React from "react";
+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 [value, setValue] = React.useState(new Set([]));
+
+ return (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
Selected: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/select/single-controlled.ts b/apps/docs/content/components/select/single-controlled.ts
index cae9bd5401..44c55e0568 100644
--- a/apps/docs/content/components/select/single-controlled.ts
+++ b/apps/docs/content/components/select/single-controlled.ts
@@ -1,81 +1,12 @@
-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 AppTs = `import {Select, SelectItem, Selection} from "@nextui-org/react";
-import {animals} from "./data";
-
-export default function App() {
- const [value, setValue] = React.useState(new Set([]));
-
- return (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
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 (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
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) => (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ ))}
+
+ );
+}
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) => (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- ))}
-
- );
-}`;
+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 (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ );
+}
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 (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- );
-}`;
+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) => (
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+
+ ))}
+
+ );
+}
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) => (
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
-
- ))}
-
- );
-}`;
+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 (
+
+ {animals.map((animal) => (
+ {animal.label}
+ ))}
+
+ );
+}
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 (
-
- {animals.map((animal) => (
-
- {animal.label}
-
- ))}
-
- );
-}`;
+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/components/skeleton/loaded.raw.jsx b/apps/docs/content/components/skeleton/loaded.raw.jsx
new file mode 100644
index 0000000000..44516e9a06
--- /dev/null
+++ b/apps/docs/content/components/skeleton/loaded.raw.jsx
@@ -0,0 +1,33 @@
+import {Card, Skeleton, Button} from "@nextui-org/react";
+
+export default function App() {
+ const [isLoaded, setIsLoaded] = React.useState(false);
+
+ const toggleLoad = () => {
+ setIsLoaded(!isLoaded);
+ };
+
+ return (
+
+
+
+
+
+
+
+
+ {isLoaded ? "Show" : "Hide"} Skeleton
+
+
+ );
+}
diff --git a/apps/docs/content/components/skeleton/loaded.ts b/apps/docs/content/components/skeleton/loaded.ts
index 59cb7528f9..cab1fe22ec 100644
--- a/apps/docs/content/components/skeleton/loaded.ts
+++ b/apps/docs/content/components/skeleton/loaded.ts
@@ -1,36 +1,4 @@
-const App = `import {Card, Skeleton, Button} from "@nextui-org/react";
-
-export default function App() {
- const [isLoaded, setIsLoaded] = React.useState(false);
-
- const toggleLoad = () => {
- setIsLoaded(!isLoaded);
- };
-
- return (
-
-
-
-
-
-
-
-
- {isLoaded ? "Show" : "Hide"} Skeleton
-
-
- );
-}`;
+import App from "./loaded.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/skeleton/standalone.raw.jsx b/apps/docs/content/components/skeleton/standalone.raw.jsx
new file mode 100644
index 0000000000..bb76f7e0d4
--- /dev/null
+++ b/apps/docs/content/components/skeleton/standalone.raw.jsx
@@ -0,0 +1,15 @@
+import {Skeleton} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/skeleton/standalone.ts b/apps/docs/content/components/skeleton/standalone.ts
index 09d0c1b510..450aed160e 100644
--- a/apps/docs/content/components/skeleton/standalone.ts
+++ b/apps/docs/content/components/skeleton/standalone.ts
@@ -1,18 +1,4 @@
-const App = `import {Skeleton} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./standalone.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/skeleton/usage.raw.jsx b/apps/docs/content/components/skeleton/usage.raw.jsx
new file mode 100644
index 0000000000..50e4660b0f
--- /dev/null
+++ b/apps/docs/content/components/skeleton/usage.raw.jsx
@@ -0,0 +1,22 @@
+import {Card, Skeleton} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/skeleton/usage.ts b/apps/docs/content/components/skeleton/usage.ts
index cdeace87e8..1118304c37 100644
--- a/apps/docs/content/components/skeleton/usage.ts
+++ b/apps/docs/content/components/skeleton/usage.ts
@@ -1,25 +1,4 @@
-const App = `import {Card, Skeleton} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/colors.raw.jsx b/apps/docs/content/components/slider/colors.raw.jsx
new file mode 100644
index 0000000000..b96faeaa72
--- /dev/null
+++ b/apps/docs/content/components/slider/colors.raw.jsx
@@ -0,0 +1,22 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const colors = ["foreground", "primary", "secondary", "success", "warning", "danger"];
+
+ return (
+
+ {colors.map((color) => (
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/colors.ts b/apps/docs/content/components/slider/colors.ts
index f26d3f88a5..d5bef810aa 100644
--- a/apps/docs/content/components/slider/colors.ts
+++ b/apps/docs/content/components/slider/colors.ts
@@ -1,32 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- const colors = [
- "foreground",
- "primary",
- "secondary",
- "success",
- "warning",
- "danger",
- ];
-
- return (
-
- {colors.map((color) => (
-
- ))}
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/controlled-change-end.raw.jsx b/apps/docs/content/components/slider/controlled-change-end.raw.jsx
new file mode 100644
index 0000000000..53360e0bef
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled-change-end.raw.jsx
@@ -0,0 +1,18 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState(25);
+
+ return (
+
+
+
Current volume: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled-change-end.raw.tsx b/apps/docs/content/components/slider/controlled-change-end.raw.tsx
new file mode 100644
index 0000000000..e88a356599
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled-change-end.raw.tsx
@@ -0,0 +1,22 @@
+import type {SliderValue} from "@nextui-org/react";
+
+import React from "react";
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState(25);
+
+ return (
+
+
+
Current volume: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled-change-end.ts b/apps/docs/content/components/slider/controlled-change-end.ts
index 5206d4118a..21ef7f007b 100644
--- a/apps/docs/content/components/slider/controlled-change-end.ts
+++ b/apps/docs/content/components/slider/controlled-change-end.ts
@@ -1,41 +1,5 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState(25);
-
- return (
-
-
-
Current volume: {value}
-
- );
-}`;
-
-const AppTs = `import {Slider, SliderValue} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState(25);
-
- return (
-
-
-
Current volume: {value}
-
- );
-}`;
+import App from "./controlled-change-end.raw.jsx?raw";
+import AppTs from "./controlled-change-end.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/controlled-range.raw.jsx b/apps/docs/content/components/slider/controlled-range.raw.jsx
new file mode 100644
index 0000000000..e5404dfc72
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled-range.raw.jsx
@@ -0,0 +1,23 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState([100, 300]);
+
+ return (
+
+
+
+ Selected budget: {Array.isArray(value) && value.map((b) => `${b}`).join(" – ")}
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled-range.raw.tsx b/apps/docs/content/components/slider/controlled-range.raw.tsx
new file mode 100644
index 0000000000..267342eb21
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled-range.raw.tsx
@@ -0,0 +1,26 @@
+import type {SliderValue} from "@nextui-org/react";
+
+import React from "react";
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState([100, 300]);
+
+ return (
+
+
+
+ Selected budget: {Array.isArray(value) && value.map((b) => `$${b}`).join(" – ")}
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled-range.ts b/apps/docs/content/components/slider/controlled-range.ts
index 61d0bf1929..90412a80b9 100644
--- a/apps/docs/content/components/slider/controlled-range.ts
+++ b/apps/docs/content/components/slider/controlled-range.ts
@@ -1,50 +1,5 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState([100, 300]);
-
- return (
-
-
-
- Selected budget: {Array.isArray(value) && value.map((b) => \`$\${b}\`).join(" – ")}
-
-
- );
-}`;
-
-const AppTs = `import {Slider, SliderValue} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState([100, 300]);
-
- return (
-
-
-
- Selected budget: {Array.isArray(value) && value.map((b) => \`$\${b}\`).join(" – ")}
-
-
- );
-}`;
+import App from "./controlled-range.raw.jsx?raw";
+import AppTs from "./controlled-range.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/controlled.raw.jsx b/apps/docs/content/components/slider/controlled.raw.jsx
new file mode 100644
index 0000000000..52cac72992
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled.raw.jsx
@@ -0,0 +1,91 @@
+import {Slider, Button} from "@nextui-org/react";
+
+export const VolumeHighIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export const VolumeLowIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export default function App() {
+ const [value, setValue] = React.useState(25);
+
+ return (
+
+
setValue((prev) => (prev <= 90 ? prev + 10 : 100))}
+ >
+
+
+ }
+ size="lg"
+ startContent={
+ setValue((prev) => (prev >= 10 ? prev - 10 : 0))}
+ >
+
+
+ }
+ value={value}
+ onChange={setValue}
+ />
+ Current volume: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled.raw.tsx b/apps/docs/content/components/slider/controlled.raw.tsx
new file mode 100644
index 0000000000..9f9728ea67
--- /dev/null
+++ b/apps/docs/content/components/slider/controlled.raw.tsx
@@ -0,0 +1,94 @@
+import type {SliderValue} from "@nextui-org/react";
+
+import React from "react";
+import {Slider, Button} from "@nextui-org/react";
+
+export const VolumeHighIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export const VolumeLowIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export default function App() {
+ const [value, setValue] = React.useState(25);
+
+ return (
+
+
setValue((prev) => (Number(prev) <= 90 ? Number(prev) + 10 : 100))}
+ >
+
+
+ }
+ size="lg"
+ startContent={
+ setValue((prev) => (Number(prev) >= 10 ? Number(prev) - 10 : 0))}
+ >
+
+
+ }
+ value={value}
+ onChange={setValue}
+ />
+ Current volume: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/controlled.ts b/apps/docs/content/components/slider/controlled.ts
index 0f7e03ef4e..1f1a363363 100644
--- a/apps/docs/content/components/slider/controlled.ts
+++ b/apps/docs/content/components/slider/controlled.ts
@@ -1,139 +1,8 @@
-const VolumeHighIcon = `export const VolumeHighIcon = (props) => (
-
-
-
-
-
-);`;
-
-const VolumeLowIcon = `export const VolumeLowIcon = (props) => (
-
-
-
-
-);`;
-
-const App = `import {Slider, Button} from "@nextui-org/react";
-import {VolumeLowIcon} from "./VolumeLowIcon";
-import {VolumeHighIcon} from "./VolumeHighIcon";
-
-export default function App() {
- const [value, setValue] = React.useState(25);
-
- return (
-
-
setValue((prev) => prev >= 10 ? prev - 10 : 0)}
- >
-
-
- }
- endContent={
- setValue((prev) => prev <= 90 ? prev + 10 : 100)}
- >
-
-
- }
- className="max-w-md"
- />
- Current volume: {value}
-
- );
-}`;
-
-const AppTs = `import {Slider, Button, SliderValue} from "@nextui-org/react";
-import {VolumeLowIcon} from "./VolumeLowIcon";
-import {VolumeHighIcon} from "./VolumeHighIcon";
-
-export default function App() {
- const [value, setValue] = React.useState(25);
-
- return (
-
-
setValue((prev) => prev >= 10 ? prev - 10 : 0)}
- >
-
-
- }
- endContent={
- setValue((prev) => prev <= 90 ? prev + 10 : 100)}
- >
-
-
- }
- className="max-w-md"
- />
- Current volume: {value}
-
- );
-}`;
+import App from "./controlled.raw.jsx?raw";
+import AppTs from "./controlled.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/VolumeHighIcon.jsx": VolumeHighIcon,
- "/VolumeLowIcon.jsx": VolumeLowIcon,
};
const reactTs = {
diff --git a/apps/docs/content/components/slider/custom-styles.raw.jsx b/apps/docs/content/components/slider/custom-styles.raw.jsx
new file mode 100644
index 0000000000..0090efa5d7
--- /dev/null
+++ b/apps/docs/content/components/slider/custom-styles.raw.jsx
@@ -0,0 +1,47 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/custom-styles.ts b/apps/docs/content/components/slider/custom-styles.ts
index 94269cc8bc..da3ea9093a 100644
--- a/apps/docs/content/components/slider/custom-styles.ts
+++ b/apps/docs/content/components/slider/custom-styles.ts
@@ -1,50 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/disable-thumb-scale.raw.jsx b/apps/docs/content/components/slider/disable-thumb-scale.raw.jsx
new file mode 100644
index 0000000000..49b2641f17
--- /dev/null
+++ b/apps/docs/content/components/slider/disable-thumb-scale.raw.jsx
@@ -0,0 +1,41 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/disable-thumb-scale.ts b/apps/docs/content/components/slider/disable-thumb-scale.ts
index 681e6fa099..a6d8994a9a 100644
--- a/apps/docs/content/components/slider/disable-thumb-scale.ts
+++ b/apps/docs/content/components/slider/disable-thumb-scale.ts
@@ -1,44 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./disable-thumb-scale.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/disabled.raw.jsx b/apps/docs/content/components/slider/disabled.raw.jsx
new file mode 100644
index 0000000000..f805a3ade7
--- /dev/null
+++ b/apps/docs/content/components/slider/disabled.raw.jsx
@@ -0,0 +1,15 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/disabled.ts b/apps/docs/content/components/slider/disabled.ts
index 07ac82bc41..1a215cc91f 100644
--- a/apps/docs/content/components/slider/disabled.ts
+++ b/apps/docs/content/components/slider/disabled.ts
@@ -1,18 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./disabled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/fill-offset.raw.jsx b/apps/docs/content/components/slider/fill-offset.raw.jsx
new file mode 100644
index 0000000000..3f432829fc
--- /dev/null
+++ b/apps/docs/content/components/slider/fill-offset.raw.jsx
@@ -0,0 +1,18 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/fill-offset.ts b/apps/docs/content/components/slider/fill-offset.ts
index e293a6fa98..3a5faaa7da 100644
--- a/apps/docs/content/components/slider/fill-offset.ts
+++ b/apps/docs/content/components/slider/fill-offset.ts
@@ -1,21 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./fill-offset.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/get-value.raw.jsx b/apps/docs/content/components/slider/get-value.raw.jsx
new file mode 100644
index 0000000000..9fb2965c6d
--- /dev/null
+++ b/apps/docs/content/components/slider/get-value.raw.jsx
@@ -0,0 +1,13 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+ `${donuts} of 60 Donuts`}
+ label="Donuts to buy"
+ maxValue={60}
+ size="sm"
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/get-value.ts b/apps/docs/content/components/slider/get-value.ts
index 58a100dbcd..b44c91bd81 100644
--- a/apps/docs/content/components/slider/get-value.ts
+++ b/apps/docs/content/components/slider/get-value.ts
@@ -1,16 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
- \`\${donuts} of 60 Donuts\`}
- className="max-w-md"
- />
- );
-}`;
+import App from "./get-value.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/hide-thumb.raw.jsx b/apps/docs/content/components/slider/hide-thumb.raw.jsx
new file mode 100644
index 0000000000..8157e09ed9
--- /dev/null
+++ b/apps/docs/content/components/slider/hide-thumb.raw.jsx
@@ -0,0 +1,13 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/hide-thumb.ts b/apps/docs/content/components/slider/hide-thumb.ts
index 4be475c9dd..bd5db5b627 100644
--- a/apps/docs/content/components/slider/hide-thumb.ts
+++ b/apps/docs/content/components/slider/hide-thumb.ts
@@ -1,16 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./hide-thumb.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/hide-value.raw.jsx b/apps/docs/content/components/slider/hide-value.raw.jsx
new file mode 100644
index 0000000000..df98a823ab
--- /dev/null
+++ b/apps/docs/content/components/slider/hide-value.raw.jsx
@@ -0,0 +1,16 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/hide-value.ts b/apps/docs/content/components/slider/hide-value.ts
index 54d1607025..cfd8be7222 100644
--- a/apps/docs/content/components/slider/hide-value.ts
+++ b/apps/docs/content/components/slider/hide-value.ts
@@ -1,19 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./hide-value.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/marks.raw.jsx b/apps/docs/content/components/slider/marks.raw.jsx
new file mode 100644
index 0000000000..ff41ef28d2
--- /dev/null
+++ b/apps/docs/content/components/slider/marks.raw.jsx
@@ -0,0 +1,28 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/marks.ts b/apps/docs/content/components/slider/marks.ts
index 07c7ac65cc..cdccdb9cea 100644
--- a/apps/docs/content/components/slider/marks.ts
+++ b/apps/docs/content/components/slider/marks.ts
@@ -1,31 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./marks.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/outline.raw.jsx b/apps/docs/content/components/slider/outline.raw.jsx
new file mode 100644
index 0000000000..67d251a4b7
--- /dev/null
+++ b/apps/docs/content/components/slider/outline.raw.jsx
@@ -0,0 +1,41 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/outline.ts b/apps/docs/content/components/slider/outline.ts
index ec94e797c3..08038eb9c4 100644
--- a/apps/docs/content/components/slider/outline.ts
+++ b/apps/docs/content/components/slider/outline.ts
@@ -1,44 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./outline.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/radius.raw.jsx b/apps/docs/content/components/slider/radius.raw.jsx
new file mode 100644
index 0000000000..181343ac11
--- /dev/null
+++ b/apps/docs/content/components/slider/radius.raw.jsx
@@ -0,0 +1,22 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ const radius = ["full", "lg", "md", "sm", "none"];
+
+ return (
+
+ {radius.map((r) => (
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/slider/radius.ts b/apps/docs/content/components/slider/radius.ts
index 6fb5696ad1..7b78db1ce0 100644
--- a/apps/docs/content/components/slider/radius.ts
+++ b/apps/docs/content/components/slider/radius.ts
@@ -1,31 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- const radius = [
- "full",
- "lg",
- "md",
- "sm",
- "none",
- ];
-
- return (
-
- {radius.map((r) => (
-
- ))}
-
- );
-}`;
+import App from "./radius.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/range.raw.jsx b/apps/docs/content/components/slider/range.raw.jsx
new file mode 100644
index 0000000000..9f733fdbb0
--- /dev/null
+++ b/apps/docs/content/components/slider/range.raw.jsx
@@ -0,0 +1,15 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/range.ts b/apps/docs/content/components/slider/range.ts
index 9b958ceee5..90e4b05194 100644
--- a/apps/docs/content/components/slider/range.ts
+++ b/apps/docs/content/components/slider/range.ts
@@ -1,18 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./range.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/render-label.raw.jsx b/apps/docs/content/components/slider/render-label.raw.jsx
new file mode 100644
index 0000000000..2af183ce22
--- /dev/null
+++ b/apps/docs/content/components/slider/render-label.raw.jsx
@@ -0,0 +1,84 @@
+import {Slider, Tooltip} from "@nextui-org/react";
+
+export const InfoIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+ (
+
+ {children}
+
+
+
+
+
+
+ )}
+ renderThumb={({index, ...props}) => (
+
+
+
+ )}
+ size="lg"
+ step={10}
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/render-label.ts b/apps/docs/content/components/slider/render-label.ts
index 5248574a7f..f4fc289c53 100644
--- a/apps/docs/content/components/slider/render-label.ts
+++ b/apps/docs/content/components/slider/render-label.ts
@@ -1,91 +1,7 @@
-const InfoIcon = `export const InfoIcon = (props) => (
-
-
-
-
-
-);
-`;
-
-const App = `import {Slider, Tooltip} from "@nextui-org/react";
-import {InfoIcon} from "./InfoIcon";
-
-export default function App() {
- return (
- (
-
- {children}
-
-
-
-
-
-
- )}
- renderThumb={({index, ...props}) => (
-
-
-
- )}
- />
- );
-}`;
+import App from "./render-label.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/InfoIcon.jsx": InfoIcon,
};
export default {
diff --git a/apps/docs/content/components/slider/render-range-thumb.raw.jsx b/apps/docs/content/components/slider/render-range-thumb.raw.jsx
new file mode 100644
index 0000000000..c9b831be31
--- /dev/null
+++ b/apps/docs/content/components/slider/render-range-thumb.raw.jsx
@@ -0,0 +1,33 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+ (
+
+
+
+ )}
+ size="lg"
+ step={10}
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/render-range-thumb.ts b/apps/docs/content/components/slider/render-range-thumb.ts
index 8f212229ca..6745f61592 100644
--- a/apps/docs/content/components/slider/render-range-thumb.ts
+++ b/apps/docs/content/components/slider/render-range-thumb.ts
@@ -1,36 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
- (
-
-
-
- )}
- />
- );
-}`;
+import App from "./render-range-thumb.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/render-thumb.raw.jsx b/apps/docs/content/components/slider/render-thumb.raw.jsx
new file mode 100644
index 0000000000..29657194a5
--- /dev/null
+++ b/apps/docs/content/components/slider/render-thumb.raw.jsx
@@ -0,0 +1,24 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+ (
+
+
+
+ )}
+ size="sm"
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/render-thumb.ts b/apps/docs/content/components/slider/render-thumb.ts
index 3a020ce676..0198aaa4a1 100644
--- a/apps/docs/content/components/slider/render-thumb.ts
+++ b/apps/docs/content/components/slider/render-thumb.ts
@@ -1,27 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
- (
-
-
-
- )}
- />
- );
-}`;
+import App from "./render-thumb.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/render-value.raw.jsx b/apps/docs/content/components/slider/render-value.raw.jsx
new file mode 100644
index 0000000000..4b548d15a4
--- /dev/null
+++ b/apps/docs/content/components/slider/render-value.raw.jsx
@@ -0,0 +1,58 @@
+import {Slider, Tooltip} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState(0.2);
+ const [inputValue, setInputValue] = React.useState("0.2");
+
+ const handleChange = (value) => {
+ if (isNaN(Number(value))) return;
+
+ setValue(value);
+ setInputValue(value.toString());
+ };
+
+ return (
+ (
+
+
+ {
+ const v = e.target.value;
+
+ setInputValue(v);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !isNaN(Number(inputValue))) {
+ setValue(Number(inputValue));
+ }
+ }}
+ />
+
+
+ )}
+ size="sm"
+ // we extract the default children to render the input
+ step={0.01}
+ value={value}
+ onChange={handleChange}
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/render-value.raw.tsx b/apps/docs/content/components/slider/render-value.raw.tsx
new file mode 100644
index 0000000000..a51b665be9
--- /dev/null
+++ b/apps/docs/content/components/slider/render-value.raw.tsx
@@ -0,0 +1,61 @@
+import type {SliderValue} from "@nextui-org/react";
+
+import React from "react";
+import {Tooltip, Slider} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState(0.2);
+ const [inputValue, setInputValue] = React.useState("0.2");
+
+ const handleChange = (value: SliderValue) => {
+ if (isNaN(Number(value))) return;
+
+ setValue(value);
+ setInputValue(value.toString());
+ };
+
+ return (
+ (
+
+
+ ) => {
+ const v = e.target.value;
+
+ setInputValue(v);
+ }}
+ onKeyDown={(e: React.KeyboardEvent) => {
+ if (e.key === "Enter" && !isNaN(Number(inputValue))) {
+ setValue(Number(inputValue));
+ }
+ }}
+ />
+
+
+ )}
+ size="sm"
+ step={0.01}
+ // we extract the default children to render the input
+ value={value}
+ onChange={handleChange}
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/render-value.ts b/apps/docs/content/components/slider/render-value.ts
index 09da36972b..ab16e1fc22 100644
--- a/apps/docs/content/components/slider/render-value.ts
+++ b/apps/docs/content/components/slider/render-value.ts
@@ -1,118 +1,5 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState(0.2);
- const [inputValue, setInputValue] = React.useState("0.2");
-
- const handleChange = (value) => {
- if (isNaN(Number(value))) return;
-
- setValue(value);
- setInputValue(value.toString());
- };
-
- return (
- (
-
-
- {
- const v = e.target.value;
-
- setInputValue(v);
- }}
- onKeyDown={(e) => {
- if (e.key === "Enter" && !isNaN(Number(inputValue))) {
- setValue(Number(inputValue));
- }
- }}
- />
-
-
- )}
- value={value}
- onChange={handleChange}
- />
- );
-}`;
-
-const AppTs = `import {Slider, SliderValue} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState(0.2);
- const [inputValue, setInputValue] = React.useState("0.2");
-
- const handleChange = (value: SliderValue) => {
- if (isNaN(Number(value))) return;
-
- setValue(value);
- setInputValue(value.toString());
- };
-
- return (
- (
-
-
- ) => {
- const v = e.target.value;
-
- setInputValue(v);
- }}
- onKeyDown={(e: React.KeyboardEvent) => {
- if (e.key === "Enter" && !isNaN(Number(inputValue))) {
- setValue(Number(inputValue));
- }
- }}
- />
-
-
- )}
- value={value}
- onChange={handleChange}
- />
- );
-}`;
+import App from "./render-value.raw.jsx?raw";
+import AppTs from "./render-value.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/sizes.raw.jsx b/apps/docs/content/components/slider/sizes.raw.jsx
new file mode 100644
index 0000000000..26693981b1
--- /dev/null
+++ b/apps/docs/content/components/slider/sizes.raw.jsx
@@ -0,0 +1,35 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/sizes.ts b/apps/docs/content/components/slider/sizes.ts
index 83741c655d..85a2f5b30b 100644
--- a/apps/docs/content/components/slider/sizes.ts
+++ b/apps/docs/content/components/slider/sizes.ts
@@ -1,38 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./sizes.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/start-end-content.raw.jsx b/apps/docs/content/components/slider/start-end-content.raw.jsx
new file mode 100644
index 0000000000..1b9172bdda
--- /dev/null
+++ b/apps/docs/content/components/slider/start-end-content.raw.jsx
@@ -0,0 +1,67 @@
+import {Slider} from "@nextui-org/react";
+
+export const VolumeHighIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export const VolumeLowIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+ }
+ size="lg"
+ startContent={ }
+ />
+ );
+}
diff --git a/apps/docs/content/components/slider/start-end-content.ts b/apps/docs/content/components/slider/start-end-content.ts
index f478eea061..e99c7e5997 100644
--- a/apps/docs/content/components/slider/start-end-content.ts
+++ b/apps/docs/content/components/slider/start-end-content.ts
@@ -1,73 +1,7 @@
-const VolumeHighIcon = `export const VolumeHighIcon = (props) => (
-
-
-
-
-
-);`;
-
-const VolumeLowIcon = `export const VolumeLowIcon = (props) => (
-
-
-
-
-);`;
-
-const App = `import {Slider} from "@nextui-org/react";
-import {VolumeLowIcon} from "./VolumeLowIcon";
-import {VolumeHighIcon} from "./VolumeHighIcon";
-
-export default function App() {
- return (
- }
- endContent={ }
- className="max-w-md"
- defaultValue={40}
- />
- );
-}`;
+import App from "./start-end-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/VolumeHighIcon.jsx": VolumeHighIcon,
- "/VolumeLowIcon.jsx": VolumeLowIcon,
};
export default {
diff --git a/apps/docs/content/components/slider/tooltip.raw.jsx b/apps/docs/content/components/slider/tooltip.raw.jsx
new file mode 100644
index 0000000000..5719863d85
--- /dev/null
+++ b/apps/docs/content/components/slider/tooltip.raw.jsx
@@ -0,0 +1,30 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/tooltip.ts b/apps/docs/content/components/slider/tooltip.ts
index bd97529987..d5f80e1265 100644
--- a/apps/docs/content/components/slider/tooltip.ts
+++ b/apps/docs/content/components/slider/tooltip.ts
@@ -1,33 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./tooltip.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/usage.raw.jsx b/apps/docs/content/components/slider/usage.raw.jsx
new file mode 100644
index 0000000000..960b8c9791
--- /dev/null
+++ b/apps/docs/content/components/slider/usage.raw.jsx
@@ -0,0 +1,14 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/usage.ts b/apps/docs/content/components/slider/usage.ts
index 9d2e81ac21..1118304c37 100644
--- a/apps/docs/content/components/slider/usage.ts
+++ b/apps/docs/content/components/slider/usage.ts
@@ -1,17 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/value-formatting.raw.jsx b/apps/docs/content/components/slider/value-formatting.raw.jsx
new file mode 100644
index 0000000000..1bd3f0cd26
--- /dev/null
+++ b/apps/docs/content/components/slider/value-formatting.raw.jsx
@@ -0,0 +1,14 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/slider/value-formatting.ts b/apps/docs/content/components/slider/value-formatting.ts
index 096dd9947f..0cd558d45d 100644
--- a/apps/docs/content/components/slider/value-formatting.ts
+++ b/apps/docs/content/components/slider/value-formatting.ts
@@ -1,17 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./value-formatting.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/vertical.raw.jsx b/apps/docs/content/components/slider/vertical.raw.jsx
new file mode 100644
index 0000000000..779c0628cd
--- /dev/null
+++ b/apps/docs/content/components/slider/vertical.raw.jsx
@@ -0,0 +1,35 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/vertical.ts b/apps/docs/content/components/slider/vertical.ts
index f3f7799b1e..697ac10343 100644
--- a/apps/docs/content/components/slider/vertical.ts
+++ b/apps/docs/content/components/slider/vertical.ts
@@ -1,38 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./vertical.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/slider/visible-steps.raw.jsx b/apps/docs/content/components/slider/visible-steps.raw.jsx
new file mode 100644
index 0000000000..d6e3690efa
--- /dev/null
+++ b/apps/docs/content/components/slider/visible-steps.raw.jsx
@@ -0,0 +1,41 @@
+import {Slider} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/slider/visible-steps.ts b/apps/docs/content/components/slider/visible-steps.ts
index da06557c73..ae20aa27a1 100644
--- a/apps/docs/content/components/slider/visible-steps.ts
+++ b/apps/docs/content/components/slider/visible-steps.ts
@@ -1,44 +1,4 @@
-const App = `import {Slider} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./visible-steps.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/colors.raw.jsx b/apps/docs/content/components/snippet/colors.raw.jsx
new file mode 100644
index 0000000000..f0f95cee40
--- /dev/null
+++ b/apps/docs/content/components/snippet/colors.raw.jsx
@@ -0,0 +1,14 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/colors.ts b/apps/docs/content/components/snippet/colors.ts
index e46614cd14..d5bef810aa 100644
--- a/apps/docs/content/components/snippet/colors.ts
+++ b/apps/docs/content/components/snippet/colors.ts
@@ -1,17 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/custom-icons.raw.jsx b/apps/docs/content/components/snippet/custom-icons.raw.jsx
new file mode 100644
index 0000000000..55d6386773
--- /dev/null
+++ b/apps/docs/content/components/snippet/custom-icons.raw.jsx
@@ -0,0 +1,43 @@
+import {Snippet} from "@nextui-org/react";
+
+export const CopyIcon = ({size, height, width, ...props}) => {
+ return (
+
+
+
+ );
+};
+
+export const CheckIcon = ({size, height, width, ...props}) => {
+ return (
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+ } copyIcon={ } variant="bordered">
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/custom-icons.ts b/apps/docs/content/components/snippet/custom-icons.ts
index 10bd84d109..7954d41595 100644
--- a/apps/docs/content/components/snippet/custom-icons.ts
+++ b/apps/docs/content/components/snippet/custom-icons.ts
@@ -1,62 +1,7 @@
-export const CopyIcon = `export const CopyIcon = ({ size, height, width, ...props }) => {
- return (
-
-
-
- );
-};`;
-
-export const CheckIcon = `export const CheckIcon = ({
- size,
- height,
- width,
- ...props
-}) => {
- return (
-
-
-
- );
-};`;
-
-const App = `import {Snippet} from "@nextui-org/react";
-import {CopyIcon} from "./CopyIcon";
-import {CheckIcon} from "./CheckIcon";
-
-export default function App() {
- return (
- }
- checkIcon={ }
- >
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./custom-icons.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/CopyIcon.jsx": CopyIcon,
- "/CheckIcon.jsx": CheckIcon,
};
export default {
diff --git a/apps/docs/content/components/snippet/custom-tooltip.raw.jsx b/apps/docs/content/components/snippet/custom-tooltip.raw.jsx
new file mode 100644
index 0000000000..5998d383fe
--- /dev/null
+++ b/apps/docs/content/components/snippet/custom-tooltip.raw.jsx
@@ -0,0 +1,17 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/custom-tooltip.ts b/apps/docs/content/components/snippet/custom-tooltip.ts
index 60ffed31d8..247cbd98de 100644
--- a/apps/docs/content/components/snippet/custom-tooltip.ts
+++ b/apps/docs/content/components/snippet/custom-tooltip.ts
@@ -1,20 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./custom-tooltip.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/multiline.raw.jsx b/apps/docs/content/components/snippet/multiline.raw.jsx
new file mode 100644
index 0000000000..189857d3b3
--- /dev/null
+++ b/apps/docs/content/components/snippet/multiline.raw.jsx
@@ -0,0 +1,11 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+ yarn add @nextui-org/react
+ pnpm add @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/multiline.ts b/apps/docs/content/components/snippet/multiline.ts
index 03b960723a..a5e525766b 100644
--- a/apps/docs/content/components/snippet/multiline.ts
+++ b/apps/docs/content/components/snippet/multiline.ts
@@ -1,14 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
- yarn add @nextui-org/react
- pnpm add @nextui-org/react
-
- );
-}`;
+import App from "./multiline.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/sizes.raw.jsx b/apps/docs/content/components/snippet/sizes.raw.jsx
new file mode 100644
index 0000000000..261e6f098c
--- /dev/null
+++ b/apps/docs/content/components/snippet/sizes.raw.jsx
@@ -0,0 +1,11 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/sizes.ts b/apps/docs/content/components/snippet/sizes.ts
index 0456000507..85a2f5b30b 100644
--- a/apps/docs/content/components/snippet/sizes.ts
+++ b/apps/docs/content/components/snippet/sizes.ts
@@ -1,14 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./sizes.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/symbol.raw.jsx b/apps/docs/content/components/snippet/symbol.raw.jsx
new file mode 100644
index 0000000000..425ff9a9ac
--- /dev/null
+++ b/apps/docs/content/components/snippet/symbol.raw.jsx
@@ -0,0 +1,9 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/symbol.ts b/apps/docs/content/components/snippet/symbol.ts
index 8215c07fa8..414f199963 100644
--- a/apps/docs/content/components/snippet/symbol.ts
+++ b/apps/docs/content/components/snippet/symbol.ts
@@ -1,10 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
- npm install @nextui-org/react
- );
-}`;
+import App from "./symbol.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/usage.raw.jsx b/apps/docs/content/components/snippet/usage.raw.jsx
new file mode 100644
index 0000000000..88cb317e61
--- /dev/null
+++ b/apps/docs/content/components/snippet/usage.raw.jsx
@@ -0,0 +1,5 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return npm install @nextui-org/react ;
+}
diff --git a/apps/docs/content/components/snippet/usage.ts b/apps/docs/content/components/snippet/usage.ts
index 38c8c5b1c0..1118304c37 100644
--- a/apps/docs/content/components/snippet/usage.ts
+++ b/apps/docs/content/components/snippet/usage.ts
@@ -1,10 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
- npm install @nextui-org/react
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/variants.raw.jsx b/apps/docs/content/components/snippet/variants.raw.jsx
new file mode 100644
index 0000000000..86dfb39028
--- /dev/null
+++ b/apps/docs/content/components/snippet/variants.raw.jsx
@@ -0,0 +1,18 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+
+ npm install @nextui-org/react
+
+
+ npm install @nextui-org/react
+
+
+ npm install @nextui-org/react
+
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/variants.ts b/apps/docs/content/components/snippet/variants.ts
index bc2d96bb01..ddea95fb2e 100644
--- a/apps/docs/content/components/snippet/variants.ts
+++ b/apps/docs/content/components/snippet/variants.ts
@@ -1,15 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./variants.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/snippet/without-copy.raw.jsx b/apps/docs/content/components/snippet/without-copy.raw.jsx
new file mode 100644
index 0000000000..baab96d178
--- /dev/null
+++ b/apps/docs/content/components/snippet/without-copy.raw.jsx
@@ -0,0 +1,9 @@
+import {Snippet} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ npm install @nextui-org/react
+
+ );
+}
diff --git a/apps/docs/content/components/snippet/without-copy.ts b/apps/docs/content/components/snippet/without-copy.ts
index 60eceab25a..9a8e663e42 100644
--- a/apps/docs/content/components/snippet/without-copy.ts
+++ b/apps/docs/content/components/snippet/without-copy.ts
@@ -1,12 +1,4 @@
-const App = `import {Snippet} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- npm install @nextui-org/react
-
- );
-}`;
+import App from "./without-copy.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/spacer/usage.raw.jsx b/apps/docs/content/components/spacer/usage.raw.jsx
new file mode 100644
index 0000000000..8eb045dd61
--- /dev/null
+++ b/apps/docs/content/components/spacer/usage.raw.jsx
@@ -0,0 +1,24 @@
+import {Spacer, Card} from "@nextui-org/react";
+
+export const CustomCard = () => (
+
+
+
+
+);
+
+export default function App() {
+ return (
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/spacer/usage.ts b/apps/docs/content/components/spacer/usage.ts
index 92882e0eb0..1118304c37 100644
--- a/apps/docs/content/components/spacer/usage.ts
+++ b/apps/docs/content/components/spacer/usage.ts
@@ -1,34 +1,7 @@
-const CustomCard = `import {Card} from "@nextui-org/react";
-
-export const CustomCard = () => (
-
-
-
-
-);`;
-
-const App = `import {Spacer} from "@nextui-org/react";
-import {CustomCard} from "./CustomCard";
-
-export default function App() {
- return (
-
-
-
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/CustomCard.jsx": CustomCard,
};
export default {
diff --git a/apps/docs/content/components/spinner/colors.raw.jsx b/apps/docs/content/components/spinner/colors.raw.jsx
new file mode 100644
index 0000000000..61dd419d98
--- /dev/null
+++ b/apps/docs/content/components/spinner/colors.raw.jsx
@@ -0,0 +1,14 @@
+import {Spinner} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/spinner/colors.ts b/apps/docs/content/components/spinner/colors.ts
index 33b27d5392..d5bef810aa 100644
--- a/apps/docs/content/components/spinner/colors.ts
+++ b/apps/docs/content/components/spinner/colors.ts
@@ -1,17 +1,4 @@
-const App = `import {Spinner} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
-
-
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/spinner/label-colors.raw.jsx b/apps/docs/content/components/spinner/label-colors.raw.jsx
new file mode 100644
index 0000000000..706793018b
--- /dev/null
+++ b/apps/docs/content/components/spinner/label-colors.raw.jsx
@@ -0,0 +1,14 @@
+import {Spinner} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/spinner/label-colors.ts b/apps/docs/content/components/spinner/label-colors.ts
index acd289fea0..38384cdf03 100644
--- a/apps/docs/content/components/spinner/label-colors.ts
+++ b/apps/docs/content/components/spinner/label-colors.ts
@@ -1,17 +1,4 @@
-const App = `import {Spinner} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
-
-
-
- );
-}`;
+import App from "./label-colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/spinner/label.raw.jsx b/apps/docs/content/components/spinner/label.raw.jsx
new file mode 100644
index 0000000000..d7f29abfa6
--- /dev/null
+++ b/apps/docs/content/components/spinner/label.raw.jsx
@@ -0,0 +1,5 @@
+import {Spinner} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/spinner/label.ts b/apps/docs/content/components/spinner/label.ts
index 3e08afd962..254b95afb8 100644
--- a/apps/docs/content/components/spinner/label.ts
+++ b/apps/docs/content/components/spinner/label.ts
@@ -1,10 +1,4 @@
-const App = `import {Spinner} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./label.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/spinner/sizes.raw.jsx b/apps/docs/content/components/spinner/sizes.raw.jsx
new file mode 100644
index 0000000000..7e740a9dd3
--- /dev/null
+++ b/apps/docs/content/components/spinner/sizes.raw.jsx
@@ -0,0 +1,11 @@
+import {Spinner} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/spinner/sizes.ts b/apps/docs/content/components/spinner/sizes.ts
index 29c59b2d3a..85a2f5b30b 100644
--- a/apps/docs/content/components/spinner/sizes.ts
+++ b/apps/docs/content/components/spinner/sizes.ts
@@ -1,14 +1,4 @@
-const App = `import {Spinner} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./sizes.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/spinner/usage.raw.jsx b/apps/docs/content/components/spinner/usage.raw.jsx
new file mode 100644
index 0000000000..0e516c76c9
--- /dev/null
+++ b/apps/docs/content/components/spinner/usage.raw.jsx
@@ -0,0 +1,5 @@
+import {Spinner} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/spinner/usage.ts b/apps/docs/content/components/spinner/usage.ts
index c61327f31c..1118304c37 100644
--- a/apps/docs/content/components/spinner/usage.ts
+++ b/apps/docs/content/components/spinner/usage.ts
@@ -1,10 +1,4 @@
-const App = `import {Spinner} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/colors.raw.jsx b/apps/docs/content/components/switch/colors.raw.jsx
new file mode 100644
index 0000000000..569b6eb4a6
--- /dev/null
+++ b/apps/docs/content/components/switch/colors.raw.jsx
@@ -0,0 +1,26 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ Default
+
+
+ Primary
+
+
+ Secondary
+
+
+ Success
+
+
+ Warning
+
+
+ Danger
+
+
+ );
+}
diff --git a/apps/docs/content/components/switch/colors.ts b/apps/docs/content/components/switch/colors.ts
index a3da415b92..d5bef810aa 100644
--- a/apps/docs/content/components/switch/colors.ts
+++ b/apps/docs/content/components/switch/colors.ts
@@ -1,17 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Default
- Primary
- Secondary
- Success
- Warning
- Danger
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/controlled.raw.jsx b/apps/docs/content/components/switch/controlled.raw.jsx
new file mode 100644
index 0000000000..2e8633b943
--- /dev/null
+++ b/apps/docs/content/components/switch/controlled.raw.jsx
@@ -0,0 +1,14 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ const [isSelected, setIsSelected] = React.useState(true);
+
+ return (
+
+
+ Airplane mode
+
+
Selected: {isSelected ? "true" : "false"}
+
+ );
+}
diff --git a/apps/docs/content/components/switch/controlled.ts b/apps/docs/content/components/switch/controlled.ts
index b7abbb6ae0..2c3f0cacb4 100644
--- a/apps/docs/content/components/switch/controlled.ts
+++ b/apps/docs/content/components/switch/controlled.ts
@@ -1,17 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- const [isSelected, setIsSelected] = React.useState(true);
-
- return (
-
-
- Airplane mode
-
-
Selected: {isSelected ? "true" : "false"}
-
- )
-}`;
+import App from "./controlled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/custom-impl.raw.jsx b/apps/docs/content/components/switch/custom-impl.raw.jsx
new file mode 100644
index 0000000000..205a5fcd4f
--- /dev/null
+++ b/apps/docs/content/components/switch/custom-impl.raw.jsx
@@ -0,0 +1,71 @@
+import {VisuallyHidden, useSwitch} from "@nextui-org/react";
+
+export const MoonIcon = (props) => {
+ return (
+
+
+
+ );
+};
+
+export const SunIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+const ThemeSwitch = (props) => {
+ const {Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps} =
+ useSwitch(props);
+
+ return (
+
+
+
+
+
+
+ {isSelected ? : }
+
+
+
Lights: {isSelected ? "on" : "off"}
+
+ );
+};
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/switch/custom-impl.raw.tsx b/apps/docs/content/components/switch/custom-impl.raw.tsx
new file mode 100644
index 0000000000..3cd1d1965f
--- /dev/null
+++ b/apps/docs/content/components/switch/custom-impl.raw.tsx
@@ -0,0 +1,72 @@
+import React from "react";
+import {useSwitch, VisuallyHidden, SwitchProps} from "@nextui-org/react";
+
+export const MoonIcon = (props) => {
+ return (
+
+
+
+ );
+};
+
+export const SunIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+const ThemeSwitch = (props: SwitchProps) => {
+ const {Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps} =
+ useSwitch(props);
+
+ return (
+
+
+
+
+
+
+ {isSelected ? : }
+
+
+
Lights: {isSelected ? "on" : "off"}
+
+ );
+};
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/switch/custom-impl.ts b/apps/docs/content/components/switch/custom-impl.ts
index 31bb02960d..ef0d8ef531 100644
--- a/apps/docs/content/components/switch/custom-impl.ts
+++ b/apps/docs/content/components/switch/custom-impl.ts
@@ -1,133 +1,12 @@
-const MoonIcon = `export const MoonIcon = (props) => (
-
-
-
-);`;
-
-const SunIcon = `export const SunIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {Switch, VisuallyHidden, useSwitch} from "@nextui-org/react";
-import {MoonIcon} from "./MoonIcon";
-import {SunIcon} from "./SunIcon";
-
-const ThemeSwitch = (props) => {
- const {
- Component,
- slots,
- isSelected,
- getBaseProps,
- getInputProps,
- getWrapperProps
- } = useSwitch(props);
-
- return (
-
-
-
-
-
-
- {isSelected ? : }
-
-
-
Lights: {isSelected ? "on" : "off"}
-
- )
-}
-
-
-export default function App() {
- return
-}`;
-
-const AppTs = `import {Switch, useSwitch, VisuallyHidden, SwitchProps} from "@nextui-org/react";
-import {MoonIcon} from "./MoonIcon";
-import {SunIcon} from "./SunIcon";
-
-const ThemeSwitch = (props: SwitchProps) => {
- const {
- Component,
- slots,
- isSelected,
- getBaseProps,
- getInputProps,
- getWrapperProps
- } = useSwitch(props);
-
- return (
-
-
-
-
-
-
- {isSelected ? : }
-
-
-
Lights: {isSelected ? "on" : "off"}
-
- )
-}
-
-
-export default function App() {
- return
-}`;
+import App from "./custom-impl.raw.jsx?raw";
+import AppTs from "./custom-impl.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/MoonIcon.jsx": MoonIcon,
- "/SunIcon.jsx": SunIcon,
};
const reactTs = {
"/App.tsx": AppTs,
- "/MoonIcon.tsx": MoonIcon,
- "/SunIcon.tsx": SunIcon,
};
export default {
diff --git a/apps/docs/content/components/switch/custom-styles.raw.jsx b/apps/docs/content/components/switch/custom-styles.raw.jsx
new file mode 100644
index 0000000000..db7a3568c9
--- /dev/null
+++ b/apps/docs/content/components/switch/custom-styles.raw.jsx
@@ -0,0 +1,32 @@
+import {Switch, cn} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
Enable early access
+
+ Get access to new features before they are released.
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/switch/custom-styles.ts b/apps/docs/content/components/switch/custom-styles.ts
index c4470a56e0..da3ea9093a 100644
--- a/apps/docs/content/components/switch/custom-styles.ts
+++ b/apps/docs/content/components/switch/custom-styles.ts
@@ -1,34 +1,4 @@
-const App = `import {Switch, cn} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
Enable early access
-
- Get access to new features before they are released.
-
-
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/disabled.raw.jsx b/apps/docs/content/components/switch/disabled.raw.jsx
new file mode 100644
index 0000000000..146c57ed38
--- /dev/null
+++ b/apps/docs/content/components/switch/disabled.raw.jsx
@@ -0,0 +1,9 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Automatic updates
+
+ );
+}
diff --git a/apps/docs/content/components/switch/disabled.ts b/apps/docs/content/components/switch/disabled.ts
index 5914c616bb..1a215cc91f 100644
--- a/apps/docs/content/components/switch/disabled.ts
+++ b/apps/docs/content/components/switch/disabled.ts
@@ -1,12 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Automatic updates
-
- );
-}`;
+import App from "./disabled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/icons.raw.jsx b/apps/docs/content/components/switch/icons.raw.jsx
new file mode 100644
index 0000000000..ce9264d15c
--- /dev/null
+++ b/apps/docs/content/components/switch/icons.raw.jsx
@@ -0,0 +1,53 @@
+import {Switch} from "@nextui-org/react";
+
+export const MoonIcon = (props) => {
+ return (
+
+
+
+ );
+};
+
+export const SunIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+ }
+ size="lg"
+ startContent={ }
+ >
+ Dark mode
+
+ );
+}
diff --git a/apps/docs/content/components/switch/icons.ts b/apps/docs/content/components/switch/icons.ts
index 3f3d9fcf1d..22a410c88f 100644
--- a/apps/docs/content/components/switch/icons.ts
+++ b/apps/docs/content/components/switch/icons.ts
@@ -1,59 +1,7 @@
-const MoonIcon = `export const MoonIcon = (props) => (
-
-
-
-);`;
-
-const SunIcon = `export const SunIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {Switch} from "@nextui-org/react";
-import {MoonIcon} from "./MoonIcon";
-import {SunIcon} from "./SunIcon";
-
-export default function App() {
- return (
- }
- endContent={ }
- >
- Dark mode
-
- );
-}`;
+import App from "./icons.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/MoonIcon.jsx": MoonIcon,
- "/SunIcon.jsx": SunIcon,
};
export default {
diff --git a/apps/docs/content/components/switch/label.raw.jsx b/apps/docs/content/components/switch/label.raw.jsx
new file mode 100644
index 0000000000..c349c1b537
--- /dev/null
+++ b/apps/docs/content/components/switch/label.raw.jsx
@@ -0,0 +1,5 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ return Automatic updates ;
+}
diff --git a/apps/docs/content/components/switch/label.ts b/apps/docs/content/components/switch/label.ts
index c9786705ff..254b95afb8 100644
--- a/apps/docs/content/components/switch/label.ts
+++ b/apps/docs/content/components/switch/label.ts
@@ -1,12 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Automatic updates
-
- );
-}`;
+import App from "./label.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/sizes.raw.jsx b/apps/docs/content/components/switch/sizes.raw.jsx
new file mode 100644
index 0000000000..36dbbb9b47
--- /dev/null
+++ b/apps/docs/content/components/switch/sizes.raw.jsx
@@ -0,0 +1,17 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ Small
+
+
+ Medium
+
+
+ Large
+
+
+ );
+}
diff --git a/apps/docs/content/components/switch/sizes.ts b/apps/docs/content/components/switch/sizes.ts
index 8a8b6f4f15..85a2f5b30b 100644
--- a/apps/docs/content/components/switch/sizes.ts
+++ b/apps/docs/content/components/switch/sizes.ts
@@ -1,14 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Small
- Medium
- Large
-
- );
-}`;
+import App from "./sizes.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/switch/thumb-icon.raw.jsx b/apps/docs/content/components/switch/thumb-icon.raw.jsx
new file mode 100644
index 0000000000..aa55ff9c33
--- /dev/null
+++ b/apps/docs/content/components/switch/thumb-icon.raw.jsx
@@ -0,0 +1,54 @@
+import {Switch} from "@nextui-org/react";
+
+export const MoonIcon = (props) => {
+ return (
+
+
+
+ );
+};
+
+export const SunIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+
+ isSelected ? :
+ }
+ >
+ Dark mode
+
+ );
+}
diff --git a/apps/docs/content/components/switch/thumb-icon.ts b/apps/docs/content/components/switch/thumb-icon.ts
index 41746fa903..4201c3f43c 100644
--- a/apps/docs/content/components/switch/thumb-icon.ts
+++ b/apps/docs/content/components/switch/thumb-icon.ts
@@ -1,64 +1,7 @@
-const MoonIcon = `export const MoonIcon = (props) => (
-
-
-
-);`;
-
-const SunIcon = `export const SunIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {Switch} from "@nextui-org/react";
-import {MoonIcon} from "./MoonIcon";
-import {SunIcon} from "./SunIcon";
-
-export default function App() {
- return (
-
- isSelected ? (
-
- ) : (
-
- )
- }
- >
- Dark mode
-
- );
-}`;
+import App from "./thumb-icon.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/MoonIcon.jsx": MoonIcon,
- "/SunIcon.jsx": SunIcon,
};
export default {
diff --git a/apps/docs/content/components/switch/usage.raw.jsx b/apps/docs/content/components/switch/usage.raw.jsx
new file mode 100644
index 0000000000..434305473b
--- /dev/null
+++ b/apps/docs/content/components/switch/usage.raw.jsx
@@ -0,0 +1,5 @@
+import {Switch} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/switch/usage.ts b/apps/docs/content/components/switch/usage.ts
index e76fed14c7..1118304c37 100644
--- a/apps/docs/content/components/switch/usage.ts
+++ b/apps/docs/content/components/switch/usage.ts
@@ -1,10 +1,4 @@
-const App = `import {Switch} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/async-pagination.raw.jsx b/apps/docs/content/components/table/async-pagination.raw.jsx
new file mode 100644
index 0000000000..266a97e842
--- /dev/null
+++ b/apps/docs/content/components/table/async-pagination.raw.jsx
@@ -0,0 +1,69 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Pagination,
+ Spinner,
+ getKeyValue,
+} from "@nextui-org/react";
+import useSWR from "swr";
+
+const fetcher = (...args) => fetch(...args).then((res) => res.json());
+
+export default function App() {
+ const [page, setPage] = React.useState(1);
+
+ const {data, isLoading} = useSWR(`https://swapi.py4e.com/api/people?page=${page}`, fetcher, {
+ keepPreviousData: true,
+ });
+
+ const rowsPerPage = 10;
+
+ const pages = React.useMemo(() => {
+ return data?.count ? Math.ceil(data.count / rowsPerPage) : 0;
+ }, [data?.count, rowsPerPage]);
+
+ const loadingState = isLoading || data?.results.length === 0 ? "loading" : "idle";
+
+ return (
+ 0 ? (
+
+ ) : null
+ }
+ >
+
+ Name
+ Height
+ Mass
+ Birth year
+
+ }
+ loadingState={loadingState}
+ >
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/async-pagination.ts b/apps/docs/content/components/table/async-pagination.ts
index f5c51a3c4f..f59ac27a4c 100644
--- a/apps/docs/content/components/table/async-pagination.ts
+++ b/apps/docs/content/components/table/async-pagination.ts
@@ -1,62 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Pagination, Spinner, getKeyValue} from "@nextui-org/react";
-import useSWR from "swr";
-
-const fetcher = (...args) => fetch(...args).then((res) => res.json());
-
-export default function App() {
- const [page, setPage] = React.useState(1);
-
- const {data, isLoading} = useSWR(\`https://swapi.py4e.com/api/people?page=\$\{page\}\`, fetcher, {
- keepPreviousData: true,
- });
-
- const rowsPerPage = 10;
-
- const pages = React.useMemo(() => {
- return data?.count ? Math.ceil(data.count / rowsPerPage) : 0;
- }, [data?.count, rowsPerPage]);
-
- const loadingState = isLoading || data?.results.length === 0 ? "loading" : "idle";
-
- return (
- 0 ? (
-
- ) : null
- }
- >
-
- Name
- Height
- Mass
- Birth year
-
- }
- loadingState={loadingState}
- >
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./async-pagination.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/controlled-selection.raw.jsx b/apps/docs/content/components/table/controlled-selection.raw.jsx
new file mode 100644
index 0000000000..3ee296f7b1
--- /dev/null
+++ b/apps/docs/content/components/table/controlled-selection.raw.jsx
@@ -0,0 +1,75 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+} from "@nextui-org/react";
+
+const rows = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+];
+
+const columns = [
+ {
+ key: "name",
+ label: "NAME",
+ },
+ {
+ key: "role",
+ label: "ROLE",
+ },
+ {
+ key: "status",
+ label: "STATUS",
+ },
+];
+
+export default function App() {
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set(["2"]));
+
+ return (
+
+
+ {(column) => {column.label} }
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/controlled-selection.ts b/apps/docs/content/components/table/controlled-selection.ts
index 0a54c2bd26..b141b81895 100644
--- a/apps/docs/content/components/table/controlled-selection.ts
+++ b/apps/docs/content/components/table/controlled-selection.ts
@@ -1,70 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue} from "@nextui-org/react";
-
-const rows = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
-];
-
-const columns = [
- {
- key: "name",
- label: "NAME",
- },
- {
- key: "role",
- label: "ROLE",
- },
- {
- key: "status",
- label: "STATUS",
- },
-];
-
-export default function App() {
- const [selectedKeys, setSelectedKeys] = React.useState(new Set(["2"]));
-
- return (
-
-
- {(column) => {column.label} }
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./controlled-selection.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/custom-cells.raw.jsx b/apps/docs/content/components/table/custom-cells.raw.jsx
new file mode 100644
index 0000000000..e29158daeb
--- /dev/null
+++ b/apps/docs/content/components/table/custom-cells.raw.jsx
@@ -0,0 +1,271 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ User,
+ Chip,
+ Tooltip,
+} from "@nextui-org/react";
+
+export const columns = [
+ {name: "NAME", uid: "name"},
+ {name: "ROLE", uid: "role"},
+ {name: "STATUS", uid: "status"},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "Community Manager",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "Sales Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+];
+
+export const EyeIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export const DeleteIcon = (props) => {
+ return (
+
+
+
+
+
+
+
+ );
+};
+
+export const EditIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+const statusColorMap = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+export default function App() {
+ const renderCell = React.useCallback((user, columnKey) => {
+ const cellValue = user[columnKey];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/custom-cells.raw.tsx b/apps/docs/content/components/table/custom-cells.raw.tsx
new file mode 100644
index 0000000000..46ff88e48c
--- /dev/null
+++ b/apps/docs/content/components/table/custom-cells.raw.tsx
@@ -0,0 +1,278 @@
+import React, {SVGProps} from "react";
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ User,
+ Chip,
+ Tooltip,
+ ChipProps,
+} from "@nextui-org/react";
+
+export type IconSvgProps = SVGProps & {
+ size?: number;
+};
+
+export const columns = [
+ {name: "NAME", uid: "name"},
+ {name: "ROLE", uid: "role"},
+ {name: "STATUS", uid: "status"},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "Community Manager",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "Sales Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+];
+
+export const EyeIcon = (props: IconSvgProps) => {
+ return (
+
+
+
+
+ );
+};
+
+export const DeleteIcon = (props: IconSvgProps) => {
+ return (
+
+
+
+
+
+
+
+ );
+};
+
+export const EditIcon = (props: IconSvgProps) => {
+ return (
+
+
+
+
+
+ );
+};
+const statusColorMap: Record = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+type User = (typeof users)[0];
+
+export default function App() {
+ const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
+ const cellValue = user[columnKey as keyof User];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/custom-cells.ts b/apps/docs/content/components/table/custom-cells.ts
index 92680efd5f..9b7f207298 100644
--- a/apps/docs/content/components/table/custom-cells.ts
+++ b/apps/docs/content/components/table/custom-cells.ts
@@ -1,366 +1,12 @@
-const data = `const columns = [
- {name: "NAME", uid: "name"},
- {name: "ROLE", uid: "role"},
- {name: "STATUS", uid: "status"},
- {name: "ACTIONS", uid: "actions"},
-];
-
-const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Technical Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Senior Developer",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "Community Manager",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "Sales Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
- email: "kristen.cooper@example.com",
- },
-];
-
-export {columns, users};`;
-
-const EyeIcon = `export const EyeIcon = (props) => (
-
-
-
-
-);`;
-
-const DeleteIcon = `export const DeleteIcon = (props) => (
-
-
-
-
-
-
-
-);`;
-
-const EditIcon = `export const EditIcon = (props) => (
-
-
-
-
-
-);`;
-
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, User, Chip, Tooltip, getKeyValue} from "@nextui-org/react";
-import {EditIcon} from "./EditIcon";
-import {DeleteIcon} from "./DeleteIcon";
-import {EyeIcon} from "./EyeIcon";
-import {columns, users} from "./data";
-
-const statusColorMap = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-export default function App() {
- const renderCell = React.useCallback((user, columnKey) => {
- const cellValue = user[columnKey];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
-
-const AppTs = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, User, Chip, Tooltip, ChipProps, getKeyValue} from "@nextui-org/react";
-import {EditIcon} from "./EditIcon";
-import {DeleteIcon} from "./DeleteIcon";
-import {EyeIcon} from "./EyeIcon";
-import {columns, users} from "./data";
-
-const statusColorMap: Record = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-type User = typeof users[0];
-
-export default function App() {
- const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
- const cellValue = user[columnKey as keyof User];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./custom-cells.raw.jsx?raw";
+import AppTs from "./custom-cells.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
- "/EditIcon.jsx": EditIcon,
- "/DeleteIcon.jsx": DeleteIcon,
- "/EyeIcon.jsx": EyeIcon,
};
const reactTs = {
"/App.tsx": AppTs,
- "/data.js": data,
- "/EditIcon.jsx": EditIcon,
- "/DeleteIcon.jsx": DeleteIcon,
- "/EyeIcon.jsx": EyeIcon,
};
export default {
diff --git a/apps/docs/content/components/table/custom-styles.raw.jsx b/apps/docs/content/components/table/custom-styles.raw.jsx
new file mode 100644
index 0000000000..f00049bb6f
--- /dev/null
+++ b/apps/docs/content/components/table/custom-styles.raw.jsx
@@ -0,0 +1,662 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Input,
+ Button,
+ DropdownTrigger,
+ Dropdown,
+ DropdownMenu,
+ DropdownItem,
+ Chip,
+ User,
+ Pagination,
+} from "@nextui-org/react";
+
+export const columns = [
+ {name: "ID", uid: "id", sortable: true},
+ {name: "NAME", uid: "name", sortable: true},
+ {name: "AGE", uid: "age", sortable: true},
+ {name: "ROLE", uid: "role", sortable: true},
+ {name: "TEAM", uid: "team"},
+ {name: "EMAIL", uid: "email"},
+ {name: "STATUS", uid: "status", sortable: true},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const statusOptions = [
+ {name: "Active", uid: "active"},
+ {name: "Paused", uid: "paused"},
+ {name: "Vacation", uid: "vacation"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://i.pravatar.cc/150?img=4",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://i.pravatar.cc/150?img=5",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?img=8",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=10",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://i.pravatar.cc/150?img=12",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://i.pravatar.cc/150?img=16",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?img=15",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?img=20",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=33",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?img=29",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://i.pravatar.cc/150?img=50",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://i.pravatar.cc/150?img=45",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export function capitalize(s) {
+ return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
+}
+
+export const PlusIcon = ({size = 24, width, height, ...props}) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export const VerticalDotsIcon = ({size = 24, width, height, ...props}) => {
+ return (
+
+
+
+ );
+};
+
+export const SearchIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}) => {
+ return (
+
+
+
+ );
+};
+
+const statusColorMap = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
+
+export default function App() {
+ const [filterValue, setFilterValue] = React.useState("");
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
+ const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
+ const [statusFilter, setStatusFilter] = React.useState("all");
+ const [rowsPerPage, setRowsPerPage] = React.useState(5);
+ const [sortDescriptor, setSortDescriptor] = React.useState({
+ column: "age",
+ direction: "ascending",
+ });
+ const [page, setPage] = React.useState(1);
+
+ const pages = Math.ceil(users.length / rowsPerPage);
+
+ const hasSearchFilter = Boolean(filterValue);
+
+ const headerColumns = React.useMemo(() => {
+ if (visibleColumns === "all") return columns;
+
+ return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
+ }, [visibleColumns]);
+
+ const filteredItems = React.useMemo(() => {
+ let filteredUsers = [...users];
+
+ if (hasSearchFilter) {
+ filteredUsers = filteredUsers.filter((user) =>
+ user.name.toLowerCase().includes(filterValue.toLowerCase()),
+ );
+ }
+ if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
+ filteredUsers = filteredUsers.filter((user) =>
+ Array.from(statusFilter).includes(user.status),
+ );
+ }
+
+ return filteredUsers;
+ }, [users, filterValue, statusFilter]);
+
+ const items = React.useMemo(() => {
+ const start = (page - 1) * rowsPerPage;
+ const end = start + rowsPerPage;
+
+ return filteredItems.slice(start, end);
+ }, [page, filteredItems, rowsPerPage]);
+
+ const sortedItems = React.useMemo(() => {
+ return [...items].sort((a, b) => {
+ const first = a[sortDescriptor.column];
+ const second = b[sortDescriptor.column];
+ const cmp = first < second ? -1 : first > second ? 1 : 0;
+
+ return sortDescriptor.direction === "descending" ? -cmp : cmp;
+ });
+ }, [sortDescriptor, items]);
+
+ const renderCell = React.useCallback((user, columnKey) => {
+ const cellValue = user[columnKey];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+ View
+ Edit
+ Delete
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ const onRowsPerPageChange = React.useCallback((e) => {
+ setRowsPerPage(Number(e.target.value));
+ setPage(1);
+ }, []);
+
+ const onSearchChange = React.useCallback((value) => {
+ if (value) {
+ setFilterValue(value);
+ setPage(1);
+ } else {
+ setFilterValue("");
+ }
+ }, []);
+
+ const topContent = React.useMemo(() => {
+ return (
+
+
+
}
+ value={filterValue}
+ variant="bordered"
+ onClear={() => setFilterValue("")}
+ onValueChange={onSearchChange}
+ />
+
+
+
+ }
+ size="sm"
+ variant="flat"
+ >
+ Status
+
+
+
+ {statusOptions.map((status) => (
+
+ {capitalize(status.name)}
+
+ ))}
+
+
+
+
+ }
+ size="sm"
+ variant="flat"
+ >
+ Columns
+
+
+
+ {columns.map((column) => (
+
+ {capitalize(column.name)}
+
+ ))}
+
+
+ } size="sm">
+ Add New
+
+
+
+
+ Total {users.length} users
+
+ Rows per page:
+
+ 5
+ 10
+ 15
+
+
+
+
+ );
+ }, [
+ filterValue,
+ statusFilter,
+ visibleColumns,
+ onSearchChange,
+ onRowsPerPageChange,
+ users.length,
+ hasSearchFilter,
+ ]);
+
+ const bottomContent = React.useMemo(() => {
+ return (
+
+
+
+ {selectedKeys === "all"
+ ? "All items selected"
+ : `${selectedKeys.size} of ${items.length} selected`}
+
+
+ );
+ }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
+
+ const classNames = React.useMemo(
+ () => ({
+ wrapper: ["max-h-[382px]", "max-w-3xl"],
+ th: ["bg-transparent", "text-default-500", "border-b", "border-divider"],
+ td: [
+ // changing the rows border radius
+ // first
+ "group-data-[first=true]/tr:first:before:rounded-none",
+ "group-data-[first=true]/tr:last:before:rounded-none",
+ // middle
+ "group-data-[middle=true]/tr:before:rounded-none",
+ // last
+ "group-data-[last=true]/tr:first:before:rounded-none",
+ "group-data-[last=true]/tr:last:before:rounded-none",
+ ],
+ }),
+ [],
+ );
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/custom-styles.raw.tsx b/apps/docs/content/components/table/custom-styles.raw.tsx
new file mode 100644
index 0000000000..4529846f56
--- /dev/null
+++ b/apps/docs/content/components/table/custom-styles.raw.tsx
@@ -0,0 +1,674 @@
+import React, {SVGProps} from "react";
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Input,
+ Button,
+ DropdownTrigger,
+ Dropdown,
+ DropdownMenu,
+ DropdownItem,
+ Chip,
+ User,
+ Pagination,
+ Selection,
+ ChipProps,
+ SortDescriptor,
+} from "@nextui-org/react";
+
+export type IconSvgProps = SVGProps & {
+ size?: number;
+};
+
+export const columns = [
+ {name: "ID", uid: "id", sortable: true},
+ {name: "NAME", uid: "name", sortable: true},
+ {name: "AGE", uid: "age", sortable: true},
+ {name: "ROLE", uid: "role", sortable: true},
+ {name: "TEAM", uid: "team"},
+ {name: "EMAIL", uid: "email"},
+ {name: "STATUS", uid: "status", sortable: true},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const statusOptions = [
+ {name: "Active", uid: "active"},
+ {name: "Paused", uid: "paused"},
+ {name: "Vacation", uid: "vacation"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "brian.kim@example.com",
+ status: "active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://i.pravatar.cc/150?img=4",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://i.pravatar.cc/150?img=5",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?img=8",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=10",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://i.pravatar.cc/150?img=12",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://i.pravatar.cc/150?img=16",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?img=15",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?img=20",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=33",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?img=29",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://i.pravatar.cc/150?img=50",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://i.pravatar.cc/150?img=45",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export function capitalize(s) {
+ return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
+}
+
+export const PlusIcon = ({size = 24, width, height, ...props}: IconSvgProps) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export const VerticalDotsIcon = ({size = 24, width, height, ...props}: IconSvgProps) => {
+ return (
+
+
+
+ );
+};
+
+export const SearchIcon = (props: IconSvgProps) => {
+ return (
+
+
+
+
+ );
+};
+
+export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}: IconSvgProps) => {
+ return (
+
+
+
+ );
+};
+
+const statusColorMap: Record = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
+
+type User = (typeof users)[0];
+
+export default function App() {
+ const [filterValue, setFilterValue] = React.useState("");
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
+ const [visibleColumns, setVisibleColumns] = React.useState(
+ new Set(INITIAL_VISIBLE_COLUMNS),
+ );
+ const [statusFilter, setStatusFilter] = React.useState("all");
+ const [rowsPerPage, setRowsPerPage] = React.useState(5);
+ const [sortDescriptor, setSortDescriptor] = React.useState({
+ column: "age",
+ direction: "ascending",
+ });
+ const [page, setPage] = React.useState(1);
+
+ const pages = Math.ceil(users.length / rowsPerPage);
+
+ const hasSearchFilter = Boolean(filterValue);
+
+ const headerColumns = React.useMemo(() => {
+ if (visibleColumns === "all") return columns;
+
+ return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
+ }, [visibleColumns]);
+
+ const filteredItems = React.useMemo(() => {
+ let filteredUsers = [...users];
+
+ if (hasSearchFilter) {
+ filteredUsers = filteredUsers.filter((user) =>
+ user.name.toLowerCase().includes(filterValue.toLowerCase()),
+ );
+ }
+ if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
+ filteredUsers = filteredUsers.filter((user) =>
+ Array.from(statusFilter).includes(user.status),
+ );
+ }
+
+ return filteredUsers;
+ }, [users, filterValue, statusFilter]);
+
+ const items = React.useMemo(() => {
+ const start = (page - 1) * rowsPerPage;
+ const end = start + rowsPerPage;
+
+ return filteredItems.slice(start, end);
+ }, [page, filteredItems, rowsPerPage]);
+
+ const sortedItems = React.useMemo(() => {
+ return [...items].sort((a: User, b: User) => {
+ const first = a[sortDescriptor.column as keyof User] as number;
+ const second = b[sortDescriptor.column as keyof User] as number;
+ const cmp = first < second ? -1 : first > second ? 1 : 0;
+
+ return sortDescriptor.direction === "descending" ? -cmp : cmp;
+ });
+ }, [sortDescriptor, items]);
+
+ const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
+ const cellValue = user[columnKey as keyof User];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+ View
+ Edit
+ Delete
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ const onRowsPerPageChange = React.useCallback((e: React.ChangeEvent) => {
+ setRowsPerPage(Number(e.target.value));
+ setPage(1);
+ }, []);
+
+ const onSearchChange = React.useCallback((value?: string) => {
+ if (value) {
+ setFilterValue(value);
+ setPage(1);
+ } else {
+ setFilterValue("");
+ }
+ }, []);
+
+ const topContent = React.useMemo(() => {
+ return (
+
+
+
}
+ value={filterValue}
+ variant="bordered"
+ onClear={() => setFilterValue("")}
+ onValueChange={onSearchChange}
+ />
+
+
+
+ }
+ size="sm"
+ variant="flat"
+ >
+ Status
+
+
+
+ {statusOptions.map((status) => (
+
+ {capitalize(status.name)}
+
+ ))}
+
+
+
+
+ }
+ size="sm"
+ variant="flat"
+ >
+ Columns
+
+
+
+ {columns.map((column) => (
+
+ {capitalize(column.name)}
+
+ ))}
+
+
+ } size="sm">
+ Add New
+
+
+
+
+ Total {users.length} users
+
+ Rows per page:
+
+ 5
+ 10
+ 15
+
+
+
+
+ );
+ }, [
+ filterValue,
+ statusFilter,
+ visibleColumns,
+ onSearchChange,
+ onRowsPerPageChange,
+ users.length,
+ hasSearchFilter,
+ ]);
+
+ const bottomContent = React.useMemo(() => {
+ return (
+
+
+
+ {selectedKeys === "all"
+ ? "All items selected"
+ : `${selectedKeys.size} of ${items.length} selected`}
+
+
+ );
+ }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
+
+ const classNames = React.useMemo(
+ () => ({
+ wrapper: ["max-h-[382px]", "max-w-3xl"],
+ th: ["bg-transparent", "text-default-500", "border-b", "border-divider"],
+ td: [
+ // changing the rows border radius
+ // first
+ "group-data-[first=true]/tr:first:before:rounded-none",
+ "group-data-[first=true]/tr:last:before:rounded-none",
+ // middle
+ "group-data-[middle=true]/tr:before:rounded-none",
+ // last
+ "group-data-[last=true]/tr:first:before:rounded-none",
+ "group-data-[last=true]/tr:last:before:rounded-none",
+ ],
+ }),
+ [],
+ );
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/custom-styles.ts b/apps/docs/content/components/table/custom-styles.ts
index 3e816ef9e5..29cf5fd0ee 100644
--- a/apps/docs/content/components/table/custom-styles.ts
+++ b/apps/docs/content/components/table/custom-styles.ts
@@ -1,1034 +1,8 @@
-const data = `const columns = [
- {name: "ID", uid: "id", sortable: true},
- {name: "NAME", uid: "name", sortable: true},
- {name: "AGE", uid: "age", sortable: true},
- {name: "ROLE", uid: "role", sortable: true},
- {name: "TEAM", uid: "team"},
- {name: "EMAIL", uid: "email"},
- {name: "STATUS", uid: "status", sortable: true},
- {name: "ACTIONS", uid: "actions"},
-];
-
-const statusOptions = [
- {name: "Active", uid: "active"},
- {name: "Paused", uid: "paused"},
- {name: "Vacation", uid: "vacation"},
-];
-
-const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://i.pravatar.cc/150?img=4",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://i.pravatar.cc/150?img=5",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?img=8",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=10",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://i.pravatar.cc/150?img=12",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://i.pravatar.cc/150?img=16",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://i.pravatar.cc/150?img=15",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?img=20",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=33",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://i.pravatar.cc/150?img=29",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://i.pravatar.cc/150?img=50",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://i.pravatar.cc/150?img=45",
- email: "mia.robinson@example.com",
- },
-];
-
-export {columns, users, statusOptions};`;
-
-const utils = `export function capitalize(s) {
- return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
-}`;
-
-const PlusIcon = `export const PlusIcon = ({size = 24, width, height, ...props}) => (
-
-
-
-
-
-
-);`;
-
-const VerticalDotsIcon = `export const VerticalDotsIcon = ({size = 24, width, height, ...props}) => (
-
-
-
-);`;
-
-const SearchIcon = `export const SearchIcon = (props) => (
-
-
-
-
-);`;
-
-const ChevronDownIcon = `export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}) => (
-
-
-
-);`;
-
-const App = `import {
- Table,
- TableHeader,
- TableColumn,
- TableBody,
- TableRow,
- TableCell,
- Input,
- Button,
- DropdownTrigger,
- Dropdown,
- DropdownMenu,
- DropdownItem,
- Chip,
- User,
- Pagination,
-} from "@nextui-org/react";
-import {PlusIcon} from "./PlusIcon";
-import {VerticalDotsIcon} from "./VerticalDotsIcon";
-import {SearchIcon} from "./SearchIcon";
-import {ChevronDownIcon} from "./ChevronDownIcon";
-import {columns, users, statusOptions} from "./data";
-import {capitalize} from "./utils";
-
-const statusColorMap = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
-
-export default function App() {
- const [filterValue, setFilterValue] = React.useState("");
- const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
- const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
- const [statusFilter, setStatusFilter] = React.useState("all");
- const [rowsPerPage, setRowsPerPage] = React.useState(5);
- const [sortDescriptor, setSortDescriptor] = React.useState({
- column: "age",
- direction: "ascending",
- });
- const [page, setPage] = React.useState(1);
-
- const pages = Math.ceil(users.length / rowsPerPage);
-
- const hasSearchFilter = Boolean(filterValue);
-
- const headerColumns = React.useMemo(() => {
- if (visibleColumns === "all") return columns;
-
- return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
- }, [visibleColumns]);
-
- const filteredItems = React.useMemo(() => {
- let filteredUsers = [...users];
-
- if (hasSearchFilter) {
- filteredUsers = filteredUsers.filter((user) =>
- user.name.toLowerCase().includes(filterValue.toLowerCase()),
- );
- }
- if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
- filteredUsers = filteredUsers.filter((user) =>
- Array.from(statusFilter).includes(user.status),
- );
- }
-
- return filteredUsers;
- }, [users, filterValue, statusFilter]);
-
- const items = React.useMemo(() => {
- const start = (page - 1) * rowsPerPage;
- const end = start + rowsPerPage;
-
- return filteredItems.slice(start, end);
- }, [page, filteredItems, rowsPerPage]);
-
- const sortedItems = React.useMemo(() => {
- return [...items].sort((a, b) => {
- const first = a[sortDescriptor.column];
- const second = b[sortDescriptor.column];
- const cmp = first < second ? -1 : first > second ? 1 : 0;
-
- return sortDescriptor.direction === "descending" ? -cmp : cmp;
- });
- }, [sortDescriptor, items]);
-
- const renderCell = React.useCallback((user, columnKey) => {
- const cellValue = user[columnKey];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
- View
- Edit
- Delete
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
- const onRowsPerPageChange = React.useCallback((e) => {
- setRowsPerPage(Number(e.target.value));
- setPage(1);
- }, []);
-
-
- const onSearchChange = React.useCallback((value) => {
- if (value) {
- setFilterValue(value);
- setPage(1);
- } else {
- setFilterValue("");
- }
- }, []);
-
- const topContent = React.useMemo(() => {
- return (
-
-
-
}
- value={filterValue}
- variant="bordered"
- onClear={() => setFilterValue("")}
- onValueChange={onSearchChange}
- />
-
-
-
- }
- size="sm"
- variant="flat"
- >
- Status
-
-
-
- {statusOptions.map((status) => (
-
- {capitalize(status.name)}
-
- ))}
-
-
-
-
- }
- size="sm"
- variant="flat"
- >
- Columns
-
-
-
- {columns.map((column) => (
-
- {capitalize(column.name)}
-
- ))}
-
-
- }
- size="sm"
- >
- Add New
-
-
-
-
- Total {users.length} users
-
- Rows per page:
-
- 5
- 10
- 15
-
-
-
-
- );
- }, [
- filterValue,
- statusFilter,
- visibleColumns,
- onSearchChange,
- onRowsPerPageChange,
- users.length,
- hasSearchFilter,
- ]);
-
- const bottomContent = React.useMemo(() => {
- return (
-
-
-
- {selectedKeys === "all"
- ? "All items selected"
- : \`\${selectedKeys.size} of \${items.length} selected\`}
-
-
- );
- }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
-
- const classNames = React.useMemo(
- () => ({
- wrapper: ["max-h-[382px]", "max-w-3xl"],
- th: ["bg-transparent", "text-default-500", "border-b", "border-divider"],
- td: [
- // changing the rows border radius
- // first
- "group-data-[first=true]:first:before:rounded-none",
- "group-data-[first=true]:last:before:rounded-none",
- // middle
- "group-data-[middle=true]:before:rounded-none",
- // last
- "group-data-[last=true]:first:before:rounded-none",
- "group-data-[last=true]:last:before:rounded-none",
- ],
- }),
- [],
- );
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
-
-const AppTs = `import {
- Table,
- TableHeader,
- TableColumn,
- TableBody,
- TableRow,
- TableCell,
- Input,
- Button,
- DropdownTrigger,
- Dropdown,
- DropdownMenu,
- DropdownItem,
- Chip,
- User,
- Pagination,
- Selection,
- ChipProps,
- SortDescriptor
-} from "@nextui-org/react";
-import {PlusIcon} from "./PlusIcon";
-import {VerticalDotsIcon} from "./VerticalDotsIcon";
-import {ChevronDownIcon} from "./ChevronDownIcon";
-import {SearchIcon} from "./SearchIcon";
-import {columns, users, statusOptions} from "./data";
-import {capitalize} from "./utils";
-
-const statusColorMap: Record = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
-
-type User = typeof users[0];
-
-export default function App() {
- const [filterValue, setFilterValue] = React.useState("");
- const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
- const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
- const [statusFilter, setStatusFilter] = React.useState("all");
- const [rowsPerPage, setRowsPerPage] = React.useState(5);
- const [sortDescriptor, setSortDescriptor] = React.useState({
- column: "age",
- direction: "ascending",
- });
- const [page, setPage] = React.useState(1);
-
- const pages = Math.ceil(users.length / rowsPerPage);
-
- const hasSearchFilter = Boolean(filterValue);
-
- const headerColumns = React.useMemo(() => {
- if (visibleColumns === "all") return columns;
-
- return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
- }, [visibleColumns]);
-
- const filteredItems = React.useMemo(() => {
- let filteredUsers = [...users];
-
- if (hasSearchFilter) {
- filteredUsers = filteredUsers.filter((user) =>
- user.name.toLowerCase().includes(filterValue.toLowerCase()),
- );
- }
- if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
- filteredUsers = filteredUsers.filter((user) =>
- Array.from(statusFilter).includes(user.status),
- );
- }
-
- return filteredUsers;
- }, [users, filterValue, statusFilter]);
-
- const items = React.useMemo(() => {
- const start = (page - 1) * rowsPerPage;
- const end = start + rowsPerPage;
-
- return filteredItems.slice(start, end);
- }, [page, filteredItems, rowsPerPage]);
-
- const sortedItems = React.useMemo(() => {
- return [...items].sort((a: User, b: User) => {
- const first = a[sortDescriptor.column as keyof User] as number;
- const second = b[sortDescriptor.column as keyof User] as number;
- const cmp = first < second ? -1 : first > second ? 1 : 0;
-
- return sortDescriptor.direction === "descending" ? -cmp : cmp;
- });
- }, [sortDescriptor, items]);
-
- const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
- const cellValue = user[columnKey as keyof User];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
- View
- Edit
- Delete
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
-
- const onRowsPerPageChange = React.useCallback((e: React.ChangeEvent) => {
- setRowsPerPage(Number(e.target.value));
- setPage(1);
- }, []);
-
- const onSearchChange = React.useCallback((value?: string) => {
- if (value) {
- setFilterValue(value);
- setPage(1);
- } else {
- setFilterValue("");
- }
- }, []);
-
- const topContent = React.useMemo(() => {
- return (
-
-
-
}
- value={filterValue}
- variant="bordered"
- onClear={() => setFilterValue("")}
- onValueChange={onSearchChange}
- />
-
-
-
- }
- size="sm"
- variant="flat"
- >
- Status
-
-
-
- {statusOptions.map((status) => (
-
- {capitalize(status.name)}
-
- ))}
-
-
-
-
- }
- size="sm"
- variant="flat"
- >
- Columns
-
-
-
- {columns.map((column) => (
-
- {capitalize(column.name)}
-
- ))}
-
-
- }
- size="sm"
- >
- Add New
-
-
-
-
- Total {users.length} users
-
- Rows per page:
-
- 5
- 10
- 15
-
-
-
-
- );
- }, [
- filterValue,
- statusFilter,
- visibleColumns,
- onSearchChange,
- onRowsPerPageChange,
- users.length,
- hasSearchFilter,
- ]);
-
- const bottomContent = React.useMemo(() => {
- return (
-
-
-
- {selectedKeys === "all"
- ? "All items selected"
- : \`\${selectedKeys.size} of \${items.length} selected\`}
-
-
- );
- }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
-
- const classNames = React.useMemo(
- () => ({
- wrapper: ["max-h-[382px]", "max-w-3xl"],
- th: ["bg-transparent", "text-default-500", "border-b", "border-divider"],
- td: [
- // changing the rows border radius
- // first
- "group-data-[first=true]:first:before:rounded-none",
- "group-data-[first=true]:last:before:rounded-none",
- // middle
- "group-data-[middle=true]:before:rounded-none",
- // last
- "group-data-[last=true]:first:before:rounded-none",
- "group-data-[last=true]:last:before:rounded-none",
- ],
- }),
- [],
- );
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
+import AppTs from "./custom-styles.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
- "/utils.js": utils,
- "/PlusIcon.jsx": PlusIcon,
- "/VerticalDotsIcon.jsx": VerticalDotsIcon,
- "/SearchIcon.jsx": SearchIcon,
- "/ChevronDownIcon.jsx": ChevronDownIcon,
};
const reactTs = {
diff --git a/apps/docs/content/components/table/disabled-rows.raw.jsx b/apps/docs/content/components/table/disabled-rows.raw.jsx
new file mode 100644
index 0000000000..2866f2b0a6
--- /dev/null
+++ b/apps/docs/content/components/table/disabled-rows.raw.jsx
@@ -0,0 +1,76 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+} from "@nextui-org/react";
+
+const rows = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+];
+
+const columns = [
+ {
+ key: "name",
+ label: "NAME",
+ },
+ {
+ key: "role",
+ label: "ROLE",
+ },
+ {
+ key: "status",
+ label: "STATUS",
+ },
+];
+
+export default function App() {
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set(["2"]));
+
+ return (
+
+
+ {(column) => {column.label} }
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/disabled-rows.ts b/apps/docs/content/components/table/disabled-rows.ts
index bdb9ba21f6..c619fe06f6 100644
--- a/apps/docs/content/components/table/disabled-rows.ts
+++ b/apps/docs/content/components/table/disabled-rows.ts
@@ -1,71 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue} from "@nextui-org/react";
-
-const rows = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
-];
-
-const columns = [
- {
- key: "name",
- label: "NAME",
- },
- {
- key: "role",
- label: "ROLE",
- },
- {
- key: "status",
- label: "STATUS",
- },
-];
-
-export default function App() {
- const [selectedKeys, setSelectedKeys] = React.useState(new Set(["2"]));
-
- return (
-
-
- {(column) => {column.label} }
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./disabled-rows.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/disallow-empty-selection.raw.jsx b/apps/docs/content/components/table/disallow-empty-selection.raw.jsx
new file mode 100644
index 0000000000..14a5db7045
--- /dev/null
+++ b/apps/docs/content/components/table/disallow-empty-selection.raw.jsx
@@ -0,0 +1,68 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ RadioGroup,
+ Radio,
+} from "@nextui-org/react";
+
+const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
+
+export default function App() {
+ const [selectedColor, setSelectedColor] = React.useState("default");
+
+ return (
+
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+
+ {colors.map((color) => (
+
+ {color}
+
+ ))}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/disallow-empty-selection.ts b/apps/docs/content/components/table/disallow-empty-selection.ts
index 474b257da0..a1abceee1f 100644
--- a/apps/docs/content/components/table/disallow-empty-selection.ts
+++ b/apps/docs/content/components/table/disallow-empty-selection.ts
@@ -1,67 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, RadioGroup, Radio} from "@nextui-org/react";
-
-const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
-
-export default function App() {
- const [selectedColor, setSelectedColor] = React.useState("default");
-
- return (
-
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
-
- {colors.map((color) => (
-
- {color}
-
- ))}
-
-
- );
-}`;
+import App from "./disallow-empty-selection.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/dynamic.raw.jsx b/apps/docs/content/components/table/dynamic.raw.jsx
new file mode 100644
index 0000000000..a6e733dd18
--- /dev/null
+++ b/apps/docs/content/components/table/dynamic.raw.jsx
@@ -0,0 +1,68 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+} from "@nextui-org/react";
+
+const rows = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+];
+
+const columns = [
+ {
+ key: "name",
+ label: "NAME",
+ },
+ {
+ key: "role",
+ label: "ROLE",
+ },
+ {
+ key: "status",
+ label: "STATUS",
+ },
+];
+
+export default function App() {
+ return (
+
+
+ {(column) => {column.label} }
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/dynamic.ts b/apps/docs/content/components/table/dynamic.ts
index bf20c16d51..5d3c97bb9a 100644
--- a/apps/docs/content/components/table/dynamic.ts
+++ b/apps/docs/content/components/table/dynamic.ts
@@ -1,63 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue} from "@nextui-org/react";
-
-const rows = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
-];
-
-const columns = [
- {
- key: "name",
- label: "NAME",
- },
- {
- key: "role",
- label: "ROLE",
- },
- {
- key: "status",
- label: "STATUS",
- },
-];
-
-export default function App() {
- return (
-
-
- {(column) => {column.label} }
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./dynamic.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/empty.raw.jsx b/apps/docs/content/components/table/empty.raw.jsx
new file mode 100644
index 0000000000..2d27a10705
--- /dev/null
+++ b/apps/docs/content/components/table/empty.raw.jsx
@@ -0,0 +1,14 @@
+import {Table, TableHeader, TableColumn, TableBody} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ NAME
+ ROLE
+ STATUS
+
+ {[]}
+
+ );
+}
diff --git a/apps/docs/content/components/table/empty.ts b/apps/docs/content/components/table/empty.ts
index 1a6e0ced1e..962836358a 100644
--- a/apps/docs/content/components/table/empty.ts
+++ b/apps/docs/content/components/table/empty.ts
@@ -1,17 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- NAME
- ROLE
- STATUS
-
- {[]}
-
- );
-}`;
+import App from "./empty.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/infinite-pagination.raw.jsx b/apps/docs/content/components/table/infinite-pagination.raw.jsx
new file mode 100644
index 0000000000..2af4de3203
--- /dev/null
+++ b/apps/docs/content/components/table/infinite-pagination.raw.jsx
@@ -0,0 +1,76 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Spinner,
+ getKeyValue,
+} from "@nextui-org/react";
+import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
+import {useAsyncList} from "@react-stately/data";
+
+export default function App() {
+ const [isLoading, setIsLoading] = React.useState(true);
+ const [hasMore, setHasMore] = React.useState(false);
+
+ let list = useAsyncList({
+ async load({signal, cursor}) {
+ if (cursor) {
+ setIsLoading(false);
+ }
+
+ // If no cursor is available, then we're loading the first page.
+ // Otherwise, the cursor is the next URL to load, as returned from the previous page.
+ const res = await fetch(cursor || "https://swapi.py4e.com/api/people/?search=", {signal});
+ let json = await res.json();
+
+ setHasMore(json.next !== null);
+
+ return {
+ items: json.results,
+ cursor: json.next,
+ };
+ },
+ });
+
+ const [loaderRef, scrollerRef] = useInfiniteScroll({hasMore, onLoadMore: list.loadMore});
+
+ return (
+
+
+
+ ) : null
+ }
+ classNames={{
+ base: "max-h-[520px] overflow-scroll",
+ table: "min-h-[400px]",
+ }}
+ >
+
+ Name
+ Height
+ Mass
+ Birth year
+
+ }
+ >
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/infinite-pagination.raw.tsx b/apps/docs/content/components/table/infinite-pagination.raw.tsx
new file mode 100644
index 0000000000..4d69e33341
--- /dev/null
+++ b/apps/docs/content/components/table/infinite-pagination.raw.tsx
@@ -0,0 +1,87 @@
+import React from "react";
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Spinner,
+ getKeyValue,
+} from "@nextui-org/react";
+import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
+import {useAsyncList} from "@react-stately/data";
+
+interface SWCharacter {
+ name: string;
+ height: string;
+ mass: string;
+ birth_year: string;
+}
+
+export default function App() {
+ const [isLoading, setIsLoading] = React.useState(true);
+ const [hasMore, setHasMore] = React.useState(false);
+
+ let list = useAsyncList({
+ async load({signal, cursor}) {
+ if (cursor) {
+ setIsLoading(false);
+ }
+
+ // If no cursor is available, then we're loading the first page.
+ // Otherwise, the cursor is the next URL to load, as returned from the previous page.
+ const res = await fetch(cursor || "https://swapi.py4e.com/api/people/?search=", {signal});
+ let json = await res.json();
+
+ setHasMore(json.next !== null);
+
+ return {
+ items: json.results,
+ cursor: json.next,
+ };
+ },
+ });
+
+ const [loaderRef, scrollerRef] = useInfiniteScroll({
+ hasMore,
+ onLoadMore: list.loadMore,
+ });
+
+ return (
+
+
+
+ ) : null
+ }
+ classNames={{
+ base: "max-h-[520px] overflow-scroll",
+ table: "min-h-[400px]",
+ }}
+ >
+
+ Name
+ Height
+ Mass
+ Birth year
+
+ }
+ >
+ {(item: SWCharacter) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/infinite-pagination.ts b/apps/docs/content/components/table/infinite-pagination.ts
index 145813869a..cdee063a64 100644
--- a/apps/docs/content/components/table/infinite-pagination.ts
+++ b/apps/docs/content/components/table/infinite-pagination.ts
@@ -1,154 +1,5 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Pagination, Spinner, getKeyValue} from "@nextui-org/react";
-import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
-import {useAsyncList} from "@react-stately/data";
-
-export default function App() {
- const [isLoading, setIsLoading] = React.useState(true);
- const [hasMore, setHasMore] = React.useState(false);
-
- let list = useAsyncList({
- async load({signal, cursor}) {
-
- if (cursor) {
- setIsLoading(false);
- }
-
- // If no cursor is available, then we're loading the first page.
- // Otherwise, the cursor is the next URL to load, as returned from the previous page.
- const res = await fetch(cursor || "https://swapi.py4e.com/api/people/?search=", {signal});
- let json = await res.json();
-
- setHasMore(json.next !== null);
-
- return {
- items: json.results,
- cursor: json.next,
- };
- },
- });
-
- const [loaderRef, scrollerRef] = useInfiniteScroll({hasMore, onLoadMore: list.loadMore});
-
- return (
-
-
-
- ) : null
- }
- classNames={{
- base: "max-h-[520px] overflow-scroll",
- table: "min-h-[400px]",
- }}
- >
-
- Name
- Height
- Mass
- Birth year
-
- }
- >
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
-
-const AppTs = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Pagination, Spinner, getKeyValue} from "@nextui-org/react";
-import { useInfiniteScroll } from "@nextui-org/use-infinite-scroll";
-import { useAsyncList } from "@react-stately/data";
-
-interface SWCharacter {
- name: string;
- height: string;
- mass: string;
- birth_year: string;
-}
-
-export default function App() {
- const [isLoading, setIsLoading] = React.useState(true);
- const [hasMore, setHasMore] = React.useState(false);
-
- let list = useAsyncList({
- async load({ signal, cursor }) {
- if (cursor) {
- setIsLoading(false);
- }
-
- // If no cursor is available, then we're loading the first page.
- // Otherwise, the cursor is the next URL to load, as returned from the previous page.
- const res = await fetch(
- cursor || "https://swapi.py4e.com/api/people/?search=",
- { signal }
- );
- let json = await res.json();
-
- setHasMore(json.next !== null);
-
- return {
- items: json.results,
- cursor: json.next,
- };
- },
- });
-
- const [loaderRef, scrollerRef] = useInfiniteScroll({
- hasMore,
- onLoadMore: list.loadMore,
- });
-
- return (
-
-
-
- ) : null
- }
- classNames={{
- base: "max-h-[520px] overflow-scroll",
- table: "min-h-[400px]",
- }}
- >
-
- Name
- Height
- Mass
- Birth year
-
- }
- >
- {(item: SWCharacter) => (
-
- {(columnKey) => (
- {getKeyValue(item, columnKey)}
- )}
-
- )}
-
-
- );
-}`;
+import App from "./infinite-pagination.raw.jsx?raw";
+import AppTs from "./infinite-pagination.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/load-more.raw.jsx b/apps/docs/content/components/table/load-more.raw.jsx
new file mode 100644
index 0000000000..a011985059
--- /dev/null
+++ b/apps/docs/content/components/table/load-more.raw.jsx
@@ -0,0 +1,80 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+ Spinner,
+ Button,
+} from "@nextui-org/react";
+import {useAsyncList} from "@react-stately/data";
+
+export default function App() {
+ const [page, setPage] = React.useState(1);
+ const [isLoading, setIsLoading] = React.useState(true);
+
+ let list = useAsyncList({
+ async load({signal, cursor}) {
+ if (cursor) {
+ setPage((prev) => prev + 1);
+ }
+
+ // If no cursor is available, then we're loading the first page.
+ // Otherwise, the cursor is the next URL to load, as returned from the previous page.
+ const res = await fetch(cursor || "https://swapi.py4e.com/api/people/?search=", {signal});
+ let json = await res.json();
+
+ if (!cursor) {
+ setIsLoading(false);
+ }
+
+ return {
+ items: json.results,
+ cursor: json.next,
+ };
+ },
+ });
+
+ const hasMore = page < 9;
+
+ return (
+
+
+ {list.isLoading && }
+ Load More
+
+
+ ) : null
+ }
+ classNames={{
+ base: "max-h-[520px] overflow-scroll",
+ table: "min-h-[420px]",
+ }}
+ >
+
+ Name
+ Height
+ Mass
+ Birth year
+
+ }
+ >
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/load-more.ts b/apps/docs/content/components/table/load-more.ts
index 70e8cd3825..872717cc04 100644
--- a/apps/docs/content/components/table/load-more.ts
+++ b/apps/docs/content/components/table/load-more.ts
@@ -1,73 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue, Spinner, Button} from "@nextui-org/react";
-import {useAsyncList} from "@react-stately/data";
-
-export default function App() {
- const [page, setPage] = React.useState(1);
- const [isLoading, setIsLoading] = React.useState(true);
-
- let list = useAsyncList({
- async load({signal, cursor}) {
- if (cursor) {
- setPage((prev) => prev + 1);
- }
-
- // If no cursor is available, then we're loading the first page.
- // Otherwise, the cursor is the next URL to load, as returned from the previous page.
- const res = await fetch(cursor || "https://swapi.py4e.com/api/people/?search=", {signal});
- let json = await res.json();
-
- if (!cursor) {
- setIsLoading(false);
- }
-
- return {
- items: json.results,
- cursor: json.next,
- };
- },
- });
-
- const hasMore = page < 9;
-
- return (
-
-
- {list.isLoading && }
- Load More
-
-
- ) : null
- }
- classNames={{
- base: "max-h-[520px] overflow-scroll",
- table: "min-h-[420px]",
- }}
- >
-
- Name
- Height
- Mass
- Birth year
-
- }
- >
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./load-more.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/multiple-selection.raw.jsx b/apps/docs/content/components/table/multiple-selection.raw.jsx
new file mode 100644
index 0000000000..e6abd5b42e
--- /dev/null
+++ b/apps/docs/content/components/table/multiple-selection.raw.jsx
@@ -0,0 +1,67 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ RadioGroup,
+ Radio,
+} from "@nextui-org/react";
+
+const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
+
+export default function App() {
+ const [selectedColor, setSelectedColor] = React.useState("default");
+
+ return (
+
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+
+ {colors.map((color) => (
+
+ {color}
+
+ ))}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/multiple-selection.ts b/apps/docs/content/components/table/multiple-selection.ts
index e5be5d114a..f03bb84fb5 100644
--- a/apps/docs/content/components/table/multiple-selection.ts
+++ b/apps/docs/content/components/table/multiple-selection.ts
@@ -1,66 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, RadioGroup, Radio} from "@nextui-org/react";
-
-const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
-
-export default function App() {
- const [selectedColor, setSelectedColor] = React.useState("default");
-
- return (
-
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
-
- {colors.map((color) => (
-
- {color}
-
- ))}
-
-
- );
-}`;
+import App from "./multiple-selection.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/paginated.raw.jsx b/apps/docs/content/components/table/paginated.raw.jsx
new file mode 100644
index 0000000000..962c2dfdd1
--- /dev/null
+++ b/apps/docs/content/components/table/paginated.raw.jsx
@@ -0,0 +1,212 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Pagination,
+ getKeyValue,
+} from "@nextui-org/react";
+
+export const users = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+ {
+ key: "5",
+ name: "Emily Collins",
+ role: "Marketing Manager",
+ status: "Active",
+ },
+ {
+ key: "6",
+ name: "Brian Kim",
+ role: "Product Manager",
+ status: "Active",
+ },
+ {
+ key: "7",
+ name: "Laura Thompson",
+ role: "UX Designer",
+ status: "Active",
+ },
+ {
+ key: "8",
+ name: "Michael Stevens",
+ role: "Data Analyst",
+ status: "Paused",
+ },
+ {
+ key: "9",
+ name: "Sophia Nguyen",
+ role: "Quality Assurance",
+ status: "Active",
+ },
+ {
+ key: "10",
+ name: "James Wilson",
+ role: "Front-end Developer",
+ status: "Vacation",
+ },
+ {
+ key: "11",
+ name: "Ava Johnson",
+ role: "Back-end Developer",
+ status: "Active",
+ },
+ {
+ key: "12",
+ name: "Isabella Smith",
+ role: "Graphic Designer",
+ status: "Active",
+ },
+ {
+ key: "13",
+ name: "Oliver Brown",
+ role: "Content Writer",
+ status: "Paused",
+ },
+ {
+ key: "14",
+ name: "Lucas Jones",
+ role: "Project Manager",
+ status: "Active",
+ },
+ {
+ key: "15",
+ name: "Grace Davis",
+ role: "HR Manager",
+ status: "Active",
+ },
+ {
+ key: "16",
+ name: "Elijah Garcia",
+ role: "Network Administrator",
+ status: "Active",
+ },
+ {
+ key: "17",
+ name: "Emma Martinez",
+ role: "Accountant",
+ status: "Vacation",
+ },
+ {
+ key: "18",
+ name: "Benjamin Lee",
+ role: "Operations Manager",
+ status: "Active",
+ },
+ {
+ key: "19",
+ name: "Mia Hernandez",
+ role: "Sales Manager",
+ status: "Paused",
+ },
+ {
+ key: "20",
+ name: "Daniel Lewis",
+ role: "DevOps Engineer",
+ status: "Active",
+ },
+ {
+ key: "21",
+ name: "Amelia Clark",
+ role: "Social Media Specialist",
+ status: "Active",
+ },
+ {
+ key: "22",
+ name: "Jackson Walker",
+ role: "Customer Support",
+ status: "Active",
+ },
+ {
+ key: "23",
+ name: "Henry Hall",
+ role: "Security Analyst",
+ status: "Active",
+ },
+ {
+ key: "24",
+ name: "Charlotte Young",
+ role: "PR Specialist",
+ status: "Paused",
+ },
+ {
+ key: "25",
+ name: "Liam King",
+ role: "Mobile App Developer",
+ status: "Active",
+ },
+];
+
+export default function App() {
+ const [page, setPage] = React.useState(1);
+ const rowsPerPage = 4;
+
+ const pages = Math.ceil(users.length / rowsPerPage);
+
+ const items = React.useMemo(() => {
+ const start = (page - 1) * rowsPerPage;
+ const end = start + rowsPerPage;
+
+ return users.slice(start, end);
+ }, [page, users]);
+
+ return (
+
+ setPage(page)}
+ />
+
+ }
+ classNames={{
+ wrapper: "min-h-[222px]",
+ }}
+ >
+
+ NAME
+ ROLE
+ STATUS
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/paginated.ts b/apps/docs/content/components/table/paginated.ts
index 75be89dc52..557add2fce 100644
--- a/apps/docs/content/components/table/paginated.ts
+++ b/apps/docs/content/components/table/paginated.ts
@@ -1,211 +1,7 @@
-const data = `export const users = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
- {
- key: "5",
- name: "Emily Collins",
- role: "Marketing Manager",
- status: "Active",
- },
- {
- key: "6",
- name: "Brian Kim",
- role: "Product Manager",
- status: "Active",
- },
- {
- key: "7",
- name: "Laura Thompson",
- role: "UX Designer",
- status: "Active",
- },
- {
- key: "8",
- name: "Michael Stevens",
- role: "Data Analyst",
- status: "Paused",
- },
- {
- key: "9",
- name: "Sophia Nguyen",
- role: "Quality Assurance",
- status: "Active",
- },
- {
- key: "10",
- name: "James Wilson",
- role: "Front-end Developer",
- status: "Vacation",
- },
- {
- key: "11",
- name: "Ava Johnson",
- role: "Back-end Developer",
- status: "Active",
- },
- {
- key: "12",
- name: "Isabella Smith",
- role: "Graphic Designer",
- status: "Active",
- },
- {
- key: "13",
- name: "Oliver Brown",
- role: "Content Writer",
- status: "Paused",
- },
- {
- key: "14",
- name: "Lucas Jones",
- role: "Project Manager",
- status: "Active",
- },
- {
- key: "15",
- name: "Grace Davis",
- role: "HR Manager",
- status: "Active",
- },
- {
- key: "16",
- name: "Elijah Garcia",
- role: "Network Administrator",
- status: "Active",
- },
- {
- key: "17",
- name: "Emma Martinez",
- role: "Accountant",
- status: "Vacation",
- },
- {
- key: "18",
- name: "Benjamin Lee",
- role: "Operations Manager",
- status: "Active",
- },
- {
- key: "19",
- name: "Mia Hernandez",
- role: "Sales Manager",
- status: "Paused",
- },
- {
- key: "20",
- name: "Daniel Lewis",
- role: "DevOps Engineer",
- status: "Active",
- },
- {
- key: "21",
- name: "Amelia Clark",
- role: "Social Media Specialist",
- status: "Active",
- },
- {
- key: "22",
- name: "Jackson Walker",
- role: "Customer Support",
- status: "Active",
- },
- {
- key: "23",
- name: "Henry Hall",
- role: "Security Analyst",
- status: "Active",
- },
- {
- key: "24",
- name: "Charlotte Young",
- role: "PR Specialist",
- status: "Paused",
- },
- {
- key: "25",
- name: "Liam King",
- role: "Mobile App Developer",
- status: "Active",
- },
-];`;
-
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Pagination, getKeyValue} from "@nextui-org/react";
-import {users} from "./data";
-
-export default function App() {
- const [page, setPage] = React.useState(1);
- const rowsPerPage = 4;
-
- const pages = Math.ceil(users.length / rowsPerPage);
-
- const items = React.useMemo(() => {
- const start = (page - 1) * rowsPerPage;
- const end = start + rowsPerPage;
-
- return users.slice(start, end);
- }, [page, users]);
-
- return (
-
- setPage(page)}
- />
-
- }
- classNames={{
- wrapper: "min-h-[222px]",
- }}
- >
-
- NAME
- ROLE
- STATUS
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./paginated.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
};
export default {
diff --git a/apps/docs/content/components/table/row-actions.raw.jsx b/apps/docs/content/components/table/row-actions.raw.jsx
new file mode 100644
index 0000000000..1e6cf2dc5a
--- /dev/null
+++ b/apps/docs/content/components/table/row-actions.raw.jsx
@@ -0,0 +1,88 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+ Radio,
+ RadioGroup,
+} from "@nextui-org/react";
+
+const rows = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+];
+
+const columns = [
+ {
+ key: "name",
+ label: "NAME",
+ },
+ {
+ key: "role",
+ label: "ROLE",
+ },
+ {
+ key: "status",
+ label: "STATUS",
+ },
+];
+
+export default function App() {
+ const [selectionBehavior, setSelectionBehavior] = React.useState("toggle");
+
+ return (
+
+
alert(`Opening item ${key}...`)}
+ >
+
+ {(column) => {column.label} }
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+
+ Toggle
+ Replace
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/row-actions.ts b/apps/docs/content/components/table/row-actions.ts
index d9d0782566..06178c6b7f 100644
--- a/apps/docs/content/components/table/row-actions.ts
+++ b/apps/docs/content/components/table/row-actions.ts
@@ -1,81 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue, Radio, RadioGroup} from "@nextui-org/react";
-
-const rows = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
-];
-
-const columns = [
- {
- key: "name",
- label: "NAME",
- },
- {
- key: "role",
- label: "ROLE",
- },
- {
- key: "status",
- label: "STATUS",
- },
-];
-
-export default function App() {
- const [selectionBehavior, setSelectionBehavior] = React.useState("toggle");
-
- return (
-
-
alert(\`Opening item \${key}...\`)}
- >
-
- {(column) => {column.label} }
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
-
- Toggle
- Replace
-
-
- );
-}`;
+import App from "./row-actions.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/selection-behavior.raw.jsx b/apps/docs/content/components/table/selection-behavior.raw.jsx
new file mode 100644
index 0000000000..d0fec4a868
--- /dev/null
+++ b/apps/docs/content/components/table/selection-behavior.raw.jsx
@@ -0,0 +1,87 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+ Radio,
+ RadioGroup,
+} from "@nextui-org/react";
+
+const rows = [
+ {
+ key: "1",
+ name: "Tony Reichert",
+ role: "CEO",
+ status: "Active",
+ },
+ {
+ key: "2",
+ name: "Zoey Lang",
+ role: "Technical Lead",
+ status: "Paused",
+ },
+ {
+ key: "3",
+ name: "Jane Fisher",
+ role: "Senior Developer",
+ status: "Active",
+ },
+ {
+ key: "4",
+ name: "William Howard",
+ role: "Community Manager",
+ status: "Vacation",
+ },
+];
+
+const columns = [
+ {
+ key: "name",
+ label: "NAME",
+ },
+ {
+ key: "role",
+ label: "ROLE",
+ },
+ {
+ key: "status",
+ label: "STATUS",
+ },
+];
+
+export default function App() {
+ const [selectionBehavior, setSelectionBehavior] = React.useState("toggle");
+
+ return (
+
+
+
+ {(column) => {column.label} }
+
+
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+
+ Toggle
+ Replace
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/selection-behavior.ts b/apps/docs/content/components/table/selection-behavior.ts
index 566480015f..b36dec6d8b 100644
--- a/apps/docs/content/components/table/selection-behavior.ts
+++ b/apps/docs/content/components/table/selection-behavior.ts
@@ -1,80 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue, Radio, RadioGroup} from "@nextui-org/react";
-
-const rows = [
- {
- key: "1",
- name: "Tony Reichert",
- role: "CEO",
- status: "Active",
- },
- {
- key: "2",
- name: "Zoey Lang",
- role: "Technical Lead",
- status: "Paused",
- },
- {
- key: "3",
- name: "Jane Fisher",
- role: "Senior Developer",
- status: "Active",
- },
- {
- key: "4",
- name: "William Howard",
- role: "Community Manager",
- status: "Vacation",
- },
-];
-
-const columns = [
- {
- key: "name",
- label: "NAME",
- },
- {
- key: "role",
- label: "ROLE",
- },
- {
- key: "status",
- label: "STATUS",
- },
-];
-
-export default function App() {
- const [selectionBehavior, setSelectionBehavior] = React.useState("toggle");
-
- return (
-
-
-
- {(column) => {column.label} }
-
-
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
-
- Toggle
- Replace
-
-
- );
-}`;
+import App from "./selection-behavior.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/single-selection.raw.jsx b/apps/docs/content/components/table/single-selection.raw.jsx
new file mode 100644
index 0000000000..35122ba3f8
--- /dev/null
+++ b/apps/docs/content/components/table/single-selection.raw.jsx
@@ -0,0 +1,67 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ RadioGroup,
+ Radio,
+} from "@nextui-org/react";
+
+const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
+
+export default function App() {
+ const [selectedColor, setSelectedColor] = React.useState("default");
+
+ return (
+
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+
+ {colors.map((color) => (
+
+ {color}
+
+ ))}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/single-selection.ts b/apps/docs/content/components/table/single-selection.ts
index e187ab933c..65d8454ff8 100644
--- a/apps/docs/content/components/table/single-selection.ts
+++ b/apps/docs/content/components/table/single-selection.ts
@@ -1,66 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, RadioGroup, Radio} from "@nextui-org/react";
-
-const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
-
-export default function App() {
- const [selectedColor, setSelectedColor] = React.useState("default");
-
- return (
-
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
-
- {colors.map((color) => (
-
- {color}
-
- ))}
-
-
- );
-}`;
+import App from "./single-selection.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/sorting.raw.jsx b/apps/docs/content/components/table/sorting.raw.jsx
new file mode 100644
index 0000000000..ddc13bfbbb
--- /dev/null
+++ b/apps/docs/content/components/table/sorting.raw.jsx
@@ -0,0 +1,82 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ getKeyValue,
+ Spinner,
+} from "@nextui-org/react";
+import {useAsyncList} from "@react-stately/data";
+
+export default function App() {
+ const [isLoading, setIsLoading] = React.useState(true);
+
+ let list = useAsyncList({
+ async load({signal}) {
+ let res = await fetch("https://swapi.py4e.com/api/people/?search", {
+ signal,
+ });
+ let json = await res.json();
+
+ setIsLoading(false);
+
+ return {
+ items: json.results,
+ };
+ },
+ async sort({items, sortDescriptor}) {
+ return {
+ items: items.sort((a, b) => {
+ let first = a[sortDescriptor.column];
+ let second = b[sortDescriptor.column];
+ let cmp = (parseInt(first) || first) < (parseInt(second) || second) ? -1 : 1;
+
+ if (sortDescriptor.direction === "descending") {
+ cmp *= -1;
+ }
+
+ return cmp;
+ }),
+ };
+ },
+ });
+
+ return (
+
+
+
+ Name
+
+
+ Height
+
+
+ Mass
+
+
+ Birth year
+
+
+ }
+ >
+ {(item) => (
+
+ {(columnKey) => {getKeyValue(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/sorting.ts b/apps/docs/content/components/table/sorting.ts
index be3f41afb6..231fa295c0 100644
--- a/apps/docs/content/components/table/sorting.ts
+++ b/apps/docs/content/components/table/sorting.ts
@@ -1,75 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue, Spinner} from "@nextui-org/react";
-import {useAsyncList} from "@react-stately/data";
-
-export default function App() {
- const [isLoading, setIsLoading] = React.useState(true);
-
- let list = useAsyncList({
- async load({signal}) {
- let res = await fetch('https://swapi.py4e.com/api/people/?search', {
- signal,
- });
- let json = await res.json();
- setIsLoading(false);
-
- return {
- items: json.results,
- };
- },
- async sort({items, sortDescriptor}) {
- return {
- items: items.sort((a, b) => {
- let first = a[sortDescriptor.column];
- let second = b[sortDescriptor.column];
- let cmp = (parseInt(first) || first) < (parseInt(second) || second) ? -1 : 1;
-
- if (sortDescriptor.direction === "descending") {
- cmp *= -1;
- }
-
- return cmp;
- }),
- };
- },
- });
-
- return (
-
-
-
- Name
-
-
- Height
-
-
- Mass
-
-
- Birth year
-
-
- }
- >
- {(item) => (
-
- {(columnKey) => {getKeyValue(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./sorting.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/striped.raw.jsx b/apps/docs/content/components/table/striped.raw.jsx
new file mode 100644
index 0000000000..a032ad7f63
--- /dev/null
+++ b/apps/docs/content/components/table/striped.raw.jsx
@@ -0,0 +1,35 @@
+import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/striped.ts b/apps/docs/content/components/table/striped.ts
index 2d9f32ff59..efcbdde82e 100644
--- a/apps/docs/content/components/table/striped.ts
+++ b/apps/docs/content/components/table/striped.ts
@@ -1,38 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
- );
-}`;
+import App from "./striped.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/usage.raw.jsx b/apps/docs/content/components/table/usage.raw.jsx
new file mode 100644
index 0000000000..b6a8bf0c51
--- /dev/null
+++ b/apps/docs/content/components/table/usage.raw.jsx
@@ -0,0 +1,35 @@
+import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/usage.ts b/apps/docs/content/components/table/usage.ts
index b6e06ec81f..1118304c37 100644
--- a/apps/docs/content/components/table/usage.ts
+++ b/apps/docs/content/components/table/usage.ts
@@ -1,38 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/use-case.raw.jsx b/apps/docs/content/components/table/use-case.raw.jsx
new file mode 100644
index 0000000000..b1bbeaf73c
--- /dev/null
+++ b/apps/docs/content/components/table/use-case.raw.jsx
@@ -0,0 +1,640 @@
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Input,
+ Button,
+ DropdownTrigger,
+ Dropdown,
+ DropdownMenu,
+ DropdownItem,
+ Chip,
+ User,
+ Pagination,
+} from "@nextui-org/react";
+
+export const columns = [
+ {name: "ID", uid: "id", sortable: true},
+ {name: "NAME", uid: "name", sortable: true},
+ {name: "AGE", uid: "age", sortable: true},
+ {name: "ROLE", uid: "role", sortable: true},
+ {name: "TEAM", uid: "team"},
+ {name: "EMAIL", uid: "email"},
+ {name: "STATUS", uid: "status", sortable: true},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const statusOptions = [
+ {name: "Active", uid: "active"},
+ {name: "Paused", uid: "paused"},
+ {name: "Vacation", uid: "vacation"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "brian.kim@example.com",
+ status: "Active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://i.pravatar.cc/150?img=4",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://i.pravatar.cc/150?img=5",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?img=8",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=10",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://i.pravatar.cc/150?img=12",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://i.pravatar.cc/150?img=16",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?img=15",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?img=20",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=33",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?img=29",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://i.pravatar.cc/150?img=50",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://i.pravatar.cc/150?img=45",
+ email: "mia.robinson@example.com",
+ },
+];
+
+export function capitalize(s) {
+ return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
+}
+
+export const PlusIcon = ({size = 24, width, height, ...props}) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export const VerticalDotsIcon = ({size = 24, width, height, ...props}) => {
+ return (
+
+
+
+ );
+};
+
+export const SearchIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}) => {
+ return (
+
+
+
+ );
+};
+
+const statusColorMap = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
+
+export default function App() {
+ const [filterValue, setFilterValue] = React.useState("");
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
+ const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
+ const [statusFilter, setStatusFilter] = React.useState("all");
+ const [rowsPerPage, setRowsPerPage] = React.useState(5);
+ const [sortDescriptor, setSortDescriptor] = React.useState({
+ column: "age",
+ direction: "ascending",
+ });
+ const [page, setPage] = React.useState(1);
+
+ const hasSearchFilter = Boolean(filterValue);
+
+ const headerColumns = React.useMemo(() => {
+ if (visibleColumns === "all") return columns;
+
+ return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
+ }, [visibleColumns]);
+
+ const filteredItems = React.useMemo(() => {
+ let filteredUsers = [...users];
+
+ if (hasSearchFilter) {
+ filteredUsers = filteredUsers.filter((user) =>
+ user.name.toLowerCase().includes(filterValue.toLowerCase()),
+ );
+ }
+ if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
+ filteredUsers = filteredUsers.filter((user) =>
+ Array.from(statusFilter).includes(user.status),
+ );
+ }
+
+ return filteredUsers;
+ }, [users, filterValue, statusFilter]);
+
+ const pages = Math.ceil(filteredItems.length / rowsPerPage);
+
+ const items = React.useMemo(() => {
+ const start = (page - 1) * rowsPerPage;
+ const end = start + rowsPerPage;
+
+ return filteredItems.slice(start, end);
+ }, [page, filteredItems, rowsPerPage]);
+
+ const sortedItems = React.useMemo(() => {
+ return [...items].sort((a, b) => {
+ const first = a[sortDescriptor.column];
+ const second = b[sortDescriptor.column];
+ const cmp = first < second ? -1 : first > second ? 1 : 0;
+
+ return sortDescriptor.direction === "descending" ? -cmp : cmp;
+ });
+ }, [sortDescriptor, items]);
+
+ const renderCell = React.useCallback((user, columnKey) => {
+ const cellValue = user[columnKey];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+ View
+ Edit
+ Delete
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ const onNextPage = React.useCallback(() => {
+ if (page < pages) {
+ setPage(page + 1);
+ }
+ }, [page, pages]);
+
+ const onPreviousPage = React.useCallback(() => {
+ if (page > 1) {
+ setPage(page - 1);
+ }
+ }, [page]);
+
+ const onRowsPerPageChange = React.useCallback((e) => {
+ setRowsPerPage(Number(e.target.value));
+ setPage(1);
+ }, []);
+
+ const onSearchChange = React.useCallback((value) => {
+ if (value) {
+ setFilterValue(value);
+ setPage(1);
+ } else {
+ setFilterValue("");
+ }
+ }, []);
+
+ const onClear = React.useCallback(() => {
+ setFilterValue("");
+ setPage(1);
+ }, []);
+
+ const topContent = React.useMemo(() => {
+ return (
+
+
+
}
+ value={filterValue}
+ onClear={() => onClear()}
+ onValueChange={onSearchChange}
+ />
+
+
+
+ } variant="flat">
+ Status
+
+
+
+ {statusOptions.map((status) => (
+
+ {capitalize(status.name)}
+
+ ))}
+
+
+
+
+ } variant="flat">
+ Columns
+
+
+
+ {columns.map((column) => (
+
+ {capitalize(column.name)}
+
+ ))}
+
+
+ }>
+ Add New
+
+
+
+
+ Total {users.length} users
+
+ Rows per page:
+
+ 5
+ 10
+ 15
+
+
+
+
+ );
+ }, [
+ filterValue,
+ statusFilter,
+ visibleColumns,
+ onRowsPerPageChange,
+ users.length,
+ onSearchChange,
+ hasSearchFilter,
+ ]);
+
+ const bottomContent = React.useMemo(() => {
+ return (
+
+
+ {selectedKeys === "all"
+ ? "All items selected"
+ : `${selectedKeys.size} of ${filteredItems.length} selected`}
+
+
+
+
+ Previous
+
+
+ Next
+
+
+
+ );
+ }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/use-case.raw.tsx b/apps/docs/content/components/table/use-case.raw.tsx
new file mode 100644
index 0000000000..e5c0113e35
--- /dev/null
+++ b/apps/docs/content/components/table/use-case.raw.tsx
@@ -0,0 +1,653 @@
+import React, {SVGProps} from "react";
+import {
+ Table,
+ TableHeader,
+ TableColumn,
+ TableBody,
+ TableRow,
+ TableCell,
+ Input,
+ Button,
+ DropdownTrigger,
+ Dropdown,
+ DropdownMenu,
+ DropdownItem,
+ Chip,
+ User,
+ Pagination,
+ Selection,
+ ChipProps,
+ SortDescriptor,
+} from "@nextui-org/react";
+
+export type IconSvgProps = SVGProps & {
+ size?: number;
+};
+
+export function capitalize(s: string) {
+ return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
+}
+
+export const PlusIcon = ({size = 24, width, height, ...props}: IconSvgProps) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export const VerticalDotsIcon = ({size = 24, width, height, ...props}: IconSvgProps) => {
+ return (
+
+
+
+ );
+};
+
+export const SearchIcon = (props: IconSvgProps) => {
+ return (
+
+
+
+
+ );
+};
+
+export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}: IconSvgProps) => {
+ return (
+
+
+
+ );
+};
+
+export const columns = [
+ {name: "ID", uid: "id", sortable: true},
+ {name: "NAME", uid: "name", sortable: true},
+ {name: "AGE", uid: "age", sortable: true},
+ {name: "ROLE", uid: "role", sortable: true},
+ {name: "TEAM", uid: "team"},
+ {name: "EMAIL", uid: "email"},
+ {name: "STATUS", uid: "status", sortable: true},
+ {name: "ACTIONS", uid: "actions"},
+];
+
+export const statusOptions = [
+ {name: "Active", uid: "active"},
+ {name: "Paused", uid: "paused"},
+ {name: "Vacation", uid: "vacation"},
+];
+
+export const users = [
+ {
+ id: 1,
+ name: "Tony Reichert",
+ role: "CEO",
+ team: "Management",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "tony.reichert@example.com",
+ },
+ {
+ id: 2,
+ name: "Zoey Lang",
+ role: "Tech Lead",
+ team: "Development",
+ status: "paused",
+ age: "25",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
+ email: "zoey.lang@example.com",
+ },
+ {
+ id: 3,
+ name: "Jane Fisher",
+ role: "Sr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
+ email: "jane.fisher@example.com",
+ },
+ {
+ id: 4,
+ name: "William Howard",
+ role: "C.M.",
+ team: "Marketing",
+ status: "vacation",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
+ email: "william.howard@example.com",
+ },
+ {
+ id: 5,
+ name: "Kristen Copper",
+ role: "S. Manager",
+ team: "Sales",
+ status: "active",
+ age: "24",
+ avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
+ email: "kristen.cooper@example.com",
+ },
+ {
+ id: 6,
+ name: "Brian Kim",
+ role: "P. Manager",
+ team: "Management",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
+ email: "brian.kim@example.com",
+ status: "Active",
+ },
+ {
+ id: 7,
+ name: "Michael Hunt",
+ role: "Designer",
+ team: "Design",
+ status: "paused",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
+ email: "michael.hunt@example.com",
+ },
+ {
+ id: 8,
+ name: "Samantha Brooks",
+ role: "HR Manager",
+ team: "HR",
+ status: "active",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
+ email: "samantha.brooks@example.com",
+ },
+ {
+ id: 9,
+ name: "Frank Harrison",
+ role: "F. Manager",
+ team: "Finance",
+ status: "vacation",
+ age: "33",
+ avatar: "https://i.pravatar.cc/150?img=4",
+ email: "frank.harrison@example.com",
+ },
+ {
+ id: 10,
+ name: "Emma Adams",
+ role: "Ops Manager",
+ team: "Operations",
+ status: "active",
+ age: "35",
+ avatar: "https://i.pravatar.cc/150?img=5",
+ email: "emma.adams@example.com",
+ },
+ {
+ id: 11,
+ name: "Brandon Stevens",
+ role: "Jr. Dev",
+ team: "Development",
+ status: "active",
+ age: "22",
+ avatar: "https://i.pravatar.cc/150?img=8",
+ email: "brandon.stevens@example.com",
+ },
+ {
+ id: 12,
+ name: "Megan Richards",
+ role: "P. Manager",
+ team: "Product",
+ status: "paused",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=10",
+ email: "megan.richards@example.com",
+ },
+ {
+ id: 13,
+ name: "Oliver Scott",
+ role: "S. Manager",
+ team: "Security",
+ status: "active",
+ age: "37",
+ avatar: "https://i.pravatar.cc/150?img=12",
+ email: "oliver.scott@example.com",
+ },
+ {
+ id: 14,
+ name: "Grace Allen",
+ role: "M. Specialist",
+ team: "Marketing",
+ status: "active",
+ age: "30",
+ avatar: "https://i.pravatar.cc/150?img=16",
+ email: "grace.allen@example.com",
+ },
+ {
+ id: 15,
+ name: "Noah Carter",
+ role: "IT Specialist",
+ team: "I. Technology",
+ status: "paused",
+ age: "31",
+ avatar: "https://i.pravatar.cc/150?img=15",
+ email: "noah.carter@example.com",
+ },
+ {
+ id: 16,
+ name: "Ava Perez",
+ role: "Manager",
+ team: "Sales",
+ status: "active",
+ age: "29",
+ avatar: "https://i.pravatar.cc/150?img=20",
+ email: "ava.perez@example.com",
+ },
+ {
+ id: 17,
+ name: "Liam Johnson",
+ role: "Data Analyst",
+ team: "Analysis",
+ status: "active",
+ age: "28",
+ avatar: "https://i.pravatar.cc/150?img=33",
+ email: "liam.johnson@example.com",
+ },
+ {
+ id: 18,
+ name: "Sophia Taylor",
+ role: "QA Analyst",
+ team: "Testing",
+ status: "active",
+ age: "27",
+ avatar: "https://i.pravatar.cc/150?img=29",
+ email: "sophia.taylor@example.com",
+ },
+ {
+ id: 19,
+ name: "Lucas Harris",
+ role: "Administrator",
+ team: "Information Technology",
+ status: "paused",
+ age: "32",
+ avatar: "https://i.pravatar.cc/150?img=50",
+ email: "lucas.harris@example.com",
+ },
+ {
+ id: 20,
+ name: "Mia Robinson",
+ role: "Coordinator",
+ team: "Operations",
+ status: "active",
+ age: "26",
+ avatar: "https://i.pravatar.cc/150?img=45",
+ email: "mia.robinson@example.com",
+ },
+];
+
+const statusColorMap: Record = {
+ active: "success",
+ paused: "danger",
+ vacation: "warning",
+};
+
+const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
+
+type User = (typeof users)[0];
+
+export default function App() {
+ const [filterValue, setFilterValue] = React.useState("");
+ const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
+ const [visibleColumns, setVisibleColumns] = React.useState(
+ new Set(INITIAL_VISIBLE_COLUMNS),
+ );
+ const [statusFilter, setStatusFilter] = React.useState("all");
+ const [rowsPerPage, setRowsPerPage] = React.useState(5);
+ const [sortDescriptor, setSortDescriptor] = React.useState({
+ column: "age",
+ direction: "ascending",
+ });
+
+ const [page, setPage] = React.useState(1);
+
+ const hasSearchFilter = Boolean(filterValue);
+
+ const headerColumns = React.useMemo(() => {
+ if (visibleColumns === "all") return columns;
+
+ return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
+ }, [visibleColumns]);
+
+ const filteredItems = React.useMemo(() => {
+ let filteredUsers = [...users];
+
+ if (hasSearchFilter) {
+ filteredUsers = filteredUsers.filter((user) =>
+ user.name.toLowerCase().includes(filterValue.toLowerCase()),
+ );
+ }
+ if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
+ filteredUsers = filteredUsers.filter((user) =>
+ Array.from(statusFilter).includes(user.status),
+ );
+ }
+
+ return filteredUsers;
+ }, [users, filterValue, statusFilter]);
+
+ const pages = Math.ceil(filteredItems.length / rowsPerPage);
+
+ const items = React.useMemo(() => {
+ const start = (page - 1) * rowsPerPage;
+ const end = start + rowsPerPage;
+
+ return filteredItems.slice(start, end);
+ }, [page, filteredItems, rowsPerPage]);
+
+ const sortedItems = React.useMemo(() => {
+ return [...items].sort((a: User, b: User) => {
+ const first = a[sortDescriptor.column as keyof User] as number;
+ const second = b[sortDescriptor.column as keyof User] as number;
+ const cmp = first < second ? -1 : first > second ? 1 : 0;
+
+ return sortDescriptor.direction === "descending" ? -cmp : cmp;
+ });
+ }, [sortDescriptor, items]);
+
+ const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
+ const cellValue = user[columnKey as keyof User];
+
+ switch (columnKey) {
+ case "name":
+ return (
+
+ {user.email}
+
+ );
+ case "role":
+ return (
+
+
{cellValue}
+
{user.team}
+
+ );
+ case "status":
+ return (
+
+ {cellValue}
+
+ );
+ case "actions":
+ return (
+
+
+
+
+
+
+
+
+ View
+ Edit
+ Delete
+
+
+
+ );
+ default:
+ return cellValue;
+ }
+ }, []);
+
+ const onNextPage = React.useCallback(() => {
+ if (page < pages) {
+ setPage(page + 1);
+ }
+ }, [page, pages]);
+
+ const onPreviousPage = React.useCallback(() => {
+ if (page > 1) {
+ setPage(page - 1);
+ }
+ }, [page]);
+
+ const onRowsPerPageChange = React.useCallback((e: React.ChangeEvent) => {
+ setRowsPerPage(Number(e.target.value));
+ setPage(1);
+ }, []);
+
+ const onSearchChange = React.useCallback((value?: string) => {
+ if (value) {
+ setFilterValue(value);
+ setPage(1);
+ } else {
+ setFilterValue("");
+ }
+ }, []);
+
+ const onClear = React.useCallback(() => {
+ setFilterValue("");
+ setPage(1);
+ }, []);
+
+ const topContent = React.useMemo(() => {
+ return (
+
+
+
}
+ value={filterValue}
+ onClear={() => onClear()}
+ onValueChange={onSearchChange}
+ />
+
+
+
+ } variant="flat">
+ Status
+
+
+
+ {statusOptions.map((status) => (
+
+ {capitalize(status.name)}
+
+ ))}
+
+
+
+
+ } variant="flat">
+ Columns
+
+
+
+ {columns.map((column) => (
+
+ {capitalize(column.name)}
+
+ ))}
+
+
+ }>
+ Add New
+
+
+
+
+ Total {users.length} users
+
+ Rows per page:
+
+ 5
+ 10
+ 15
+
+
+
+
+ );
+ }, [
+ filterValue,
+ statusFilter,
+ visibleColumns,
+ onSearchChange,
+ onRowsPerPageChange,
+ users.length,
+ hasSearchFilter,
+ ]);
+
+ const bottomContent = React.useMemo(() => {
+ return (
+
+
+ {selectedKeys === "all"
+ ? "All items selected"
+ : `${selectedKeys.size} of ${filteredItems.length} selected`}
+
+
+
+
+ Previous
+
+
+ Next
+
+
+
+ );
+ }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
+
+ return (
+
+
+ {(column) => (
+
+ {column.name}
+
+ )}
+
+
+ {(item) => (
+
+ {(columnKey) => {renderCell(item, columnKey)} }
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/use-case.ts b/apps/docs/content/components/table/use-case.ts
index b46e960e7c..a03774d7c8 100644
--- a/apps/docs/content/components/table/use-case.ts
+++ b/apps/docs/content/components/table/use-case.ts
@@ -1,1324 +1,12 @@
-const data = `const columns = [
- {name: "ID", uid: "id", sortable: true},
- {name: "NAME", uid: "name", sortable: true},
- {name: "AGE", uid: "age", sortable: true},
- {name: "ROLE", uid: "role", sortable: true},
- {name: "TEAM", uid: "team"},
- {name: "EMAIL", uid: "email"},
- {name: "STATUS", uid: "status", sortable: true},
- {name: "ACTIONS", uid: "actions"},
-];
-
-const statusOptions = [
- {name: "Active", uid: "active"},
- {name: "Paused", uid: "paused"},
- {name: "Vacation", uid: "vacation"},
-];
-
-const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "brian.kim@example.com",
- status: "active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://i.pravatar.cc/150?img=4",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://i.pravatar.cc/150?img=5",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?img=8",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=10",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://i.pravatar.cc/150?img=12",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://i.pravatar.cc/150?img=16",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://i.pravatar.cc/150?img=15",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?img=20",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=33",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://i.pravatar.cc/150?img=29",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://i.pravatar.cc/150?img=50",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://i.pravatar.cc/150?img=45",
- email: "mia.robinson@example.com",
- },
-];
-
-export {columns, users, statusOptions};`;
-
-const dataTs = `const columns = [
- {name: "ID", uid: "id", sortable: true},
- {name: "NAME", uid: "name", sortable: true},
- {name: "AGE", uid: "age", sortable: true},
- {name: "ROLE", uid: "role", sortable: true},
- {name: "TEAM", uid: "team"},
- {name: "EMAIL", uid: "email"},
- {name: "STATUS", uid: "status", sortable: true},
- {name: "ACTIONS", uid: "actions"},
-];
-
-const statusOptions = [
- {name: "Active", uid: "active"},
- {name: "Paused", uid: "paused"},
- {name: "Vacation", uid: "vacation"},
-];
-
-const users = [
- {
- id: 1,
- name: "Tony Reichert",
- role: "CEO",
- team: "Management",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "tony.reichert@example.com",
- },
- {
- id: 2,
- name: "Zoey Lang",
- role: "Tech Lead",
- team: "Development",
- status: "paused",
- age: "25",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d",
- email: "zoey.lang@example.com",
- },
- {
- id: 3,
- name: "Jane Fisher",
- role: "Sr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d",
- email: "jane.fisher@example.com",
- },
- {
- id: 4,
- name: "William Howard",
- role: "C.M.",
- team: "Marketing",
- status: "vacation",
- age: "28",
- avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d",
- email: "william.howard@example.com",
- },
- {
- id: 5,
- name: "Kristen Copper",
- role: "S. Manager",
- team: "Sales",
- status: "active",
- age: "24",
- avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d",
- email: "kristen.cooper@example.com",
- },
- {
- id: 6,
- name: "Brian Kim",
- role: "P. Manager",
- team: "Management",
- age: "29",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d",
- email: "brian.kim@example.com",
- status: "Active",
- },
- {
- id: 7,
- name: "Michael Hunt",
- role: "Designer",
- team: "Design",
- status: "paused",
- age: "27",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e29027007d",
- email: "michael.hunt@example.com",
- },
- {
- id: 8,
- name: "Samantha Brooks",
- role: "HR Manager",
- team: "HR",
- status: "active",
- age: "31",
- avatar: "https://i.pravatar.cc/150?u=a042581f4e27027008d",
- email: "samantha.brooks@example.com",
- },
- {
- id: 9,
- name: "Frank Harrison",
- role: "F. Manager",
- team: "Finance",
- status: "vacation",
- age: "33",
- avatar: "https://i.pravatar.cc/150?img=4",
- email: "frank.harrison@example.com",
- },
- {
- id: 10,
- name: "Emma Adams",
- role: "Ops Manager",
- team: "Operations",
- status: "active",
- age: "35",
- avatar: "https://i.pravatar.cc/150?img=5",
- email: "emma.adams@example.com",
- },
- {
- id: 11,
- name: "Brandon Stevens",
- role: "Jr. Dev",
- team: "Development",
- status: "active",
- age: "22",
- avatar: "https://i.pravatar.cc/150?img=8",
- email: "brandon.stevens@example.com",
- },
- {
- id: 12,
- name: "Megan Richards",
- role: "P. Manager",
- team: "Product",
- status: "paused",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=10",
- email: "megan.richards@example.com",
- },
- {
- id: 13,
- name: "Oliver Scott",
- role: "S. Manager",
- team: "Security",
- status: "active",
- age: "37",
- avatar: "https://i.pravatar.cc/150?img=12",
- email: "oliver.scott@example.com",
- },
- {
- id: 14,
- name: "Grace Allen",
- role: "M. Specialist",
- team: "Marketing",
- status: "active",
- age: "30",
- avatar: "https://i.pravatar.cc/150?img=16",
- email: "grace.allen@example.com",
- },
- {
- id: 15,
- name: "Noah Carter",
- role: "IT Specialist",
- team: "I. Technology",
- status: "paused",
- age: "31",
- avatar: "https://i.pravatar.cc/150?img=15",
- email: "noah.carter@example.com",
- },
- {
- id: 16,
- name: "Ava Perez",
- role: "Manager",
- team: "Sales",
- status: "active",
- age: "29",
- avatar: "https://i.pravatar.cc/150?img=20",
- email: "ava.perez@example.com",
- },
- {
- id: 17,
- name: "Liam Johnson",
- role: "Data Analyst",
- team: "Analysis",
- status: "active",
- age: "28",
- avatar: "https://i.pravatar.cc/150?img=33",
- email: "liam.johnson@example.com",
- },
- {
- id: 18,
- name: "Sophia Taylor",
- role: "QA Analyst",
- team: "Testing",
- status: "active",
- age: "27",
- avatar: "https://i.pravatar.cc/150?img=29",
- email: "sophia.taylor@example.com",
- },
- {
- id: 19,
- name: "Lucas Harris",
- role: "Administrator",
- team: "Information Technology",
- status: "paused",
- age: "32",
- avatar: "https://i.pravatar.cc/150?img=50",
- email: "lucas.harris@example.com",
- },
- {
- id: 20,
- name: "Mia Robinson",
- role: "Coordinator",
- team: "Operations",
- status: "active",
- age: "26",
- avatar: "https://i.pravatar.cc/150?img=45",
- email: "mia.robinson@example.com",
- },
-];
-
-export {columns, users, statusOptions};`;
-
-const types = `import {SVGProps} from "react";
-
-export type IconSvgProps = SVGProps & {
- size?: number;
-};`;
-
-const utils = `export function capitalize(s) {
- return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
-}`;
-
-const PlusIcon = `export const PlusIcon = ({size = 24, width, height, ...props}) => (
-
-
-
-
-
-
-);`;
-
-const VerticalDotsIcon = `export const VerticalDotsIcon = ({size = 24, width, height, ...props}) => (
-
-
-
-);`;
-
-const SearchIcon = `export const SearchIcon = (props) => (
-
-
-
-
-);`;
-
-const ChevronDownIcon = `export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}) => (
-
-
-
-);`;
-
-const utilsTs = `export function capitalize(s: string) {
- return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
-}`;
-
-const PlusIconTs = `import {IconSvgProps} from "./types";
-
-export const PlusIcon = ({size = 24, width, height, ...props}: IconSvgProps) => (
-
-
-
-
-
-
-);`;
-
-const VerticalDotsIconTs = `import {IconSvgProps} from "./types";
-
-export const VerticalDotsIcon = ({size = 24, width, height, ...props}: IconSvgProps) => (
-
-
-
-);`;
-
-const SearchIconTs = `import {IconSvgProps} from "./types";
-
-export const SearchIcon = (props: IconSvgProps) => (
-
-
-
-
-);`;
-
-const ChevronDownIconTs = `import {IconSvgProps} from "./types";
-
-export const ChevronDownIcon = ({strokeWidth = 1.5, ...otherProps}: IconSvgProps) => (
-
-
-
-);`;
-
-const App = `import {
- Table,
- TableHeader,
- TableColumn,
- TableBody,
- TableRow,
- TableCell,
- Input,
- Button,
- DropdownTrigger,
- Dropdown,
- DropdownMenu,
- DropdownItem,
- Chip,
- User,
- Pagination,
-} from "@nextui-org/react";
-import {PlusIcon} from "./PlusIcon";
-import {VerticalDotsIcon} from "./VerticalDotsIcon";
-import {SearchIcon} from "./SearchIcon";
-import {ChevronDownIcon} from "./ChevronDownIcon";
-import {columns, users, statusOptions} from "./data";
-import {capitalize} from "./utils";
-
-const statusColorMap = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
-
-export default function App() {
- const [filterValue, setFilterValue] = React.useState("");
- const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
- const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
- const [statusFilter, setStatusFilter] = React.useState("all");
- const [rowsPerPage, setRowsPerPage] = React.useState(5);
- const [sortDescriptor, setSortDescriptor] = React.useState({
- column: "age",
- direction: "ascending",
- });
- const [page, setPage] = React.useState(1);
-
- const hasSearchFilter = Boolean(filterValue);
-
- const headerColumns = React.useMemo(() => {
- if (visibleColumns === "all") return columns;
-
- return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
- }, [visibleColumns]);
-
- const filteredItems = React.useMemo(() => {
- let filteredUsers = [...users];
-
- if (hasSearchFilter) {
- filteredUsers = filteredUsers.filter((user) =>
- user.name.toLowerCase().includes(filterValue.toLowerCase()),
- );
- }
- if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
- filteredUsers = filteredUsers.filter((user) =>
- Array.from(statusFilter).includes(user.status),
- );
- }
-
- return filteredUsers;
- }, [users, filterValue, statusFilter]);
-
- const pages = Math.ceil(filteredItems.length / rowsPerPage);
-
- const items = React.useMemo(() => {
- const start = (page - 1) * rowsPerPage;
- const end = start + rowsPerPage;
-
- return filteredItems.slice(start, end);
- }, [page, filteredItems, rowsPerPage]);
-
- const sortedItems = React.useMemo(() => {
- return [...items].sort((a, b) => {
- const first = a[sortDescriptor.column];
- const second = b[sortDescriptor.column];
- const cmp = first < second ? -1 : first > second ? 1 : 0;
-
- return sortDescriptor.direction === "descending" ? -cmp : cmp;
- });
- }, [sortDescriptor, items]);
-
- const renderCell = React.useCallback((user, columnKey) => {
- const cellValue = user[columnKey];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
- View
- Edit
- Delete
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
- const onNextPage = React.useCallback(() => {
- if (page < pages) {
- setPage(page + 1);
- }
- }, [page, pages]);
-
- const onPreviousPage = React.useCallback(() => {
- if (page > 1) {
- setPage(page - 1);
- }
- }, [page]);
-
- const onRowsPerPageChange = React.useCallback((e) => {
- setRowsPerPage(Number(e.target.value));
- setPage(1);
- }, []);
-
- const onSearchChange = React.useCallback((value) => {
- if (value) {
- setFilterValue(value);
- setPage(1);
- } else {
- setFilterValue("");
- }
- }, []);
-
- const onClear = React.useCallback(()=>{
- setFilterValue("")
- setPage(1)
- },[])
-
- const topContent = React.useMemo(() => {
- return (
-
-
-
}
- value={filterValue}
- onClear={() => onClear()}
- onValueChange={onSearchChange}
- />
-
-
-
- } variant="flat">
- Status
-
-
-
- {statusOptions.map((status) => (
-
- {capitalize(status.name)}
-
- ))}
-
-
-
-
- } variant="flat">
- Columns
-
-
-
- {columns.map((column) => (
-
- {capitalize(column.name)}
-
- ))}
-
-
- }>
- Add New
-
-
-
-
- Total {users.length} users
-
- Rows per page:
-
- 5
- 10
- 15
-
-
-
-
- );
- }, [
- filterValue,
- statusFilter,
- visibleColumns,
- onRowsPerPageChange,
- users.length,
- onSearchChange,
- hasSearchFilter,
- ]);
-
- const bottomContent = React.useMemo(() => {
- return (
-
-
- {selectedKeys === "all"
- ? "All items selected"
- : \`\${selectedKeys.size} of \${filteredItems.length} selected\`}
-
-
-
-
- Previous
-
-
- Next
-
-
-
- );
- }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
-
-const AppTs = `import {
- Table,
- TableHeader,
- TableColumn,
- TableBody,
- TableRow,
- TableCell,
- Input,
- Button,
- DropdownTrigger,
- Dropdown,
- DropdownMenu,
- DropdownItem,
- Chip,
- User,
- Pagination,
- Selection,
- ChipProps,
- SortDescriptor
-} from "@nextui-org/react";
-import {PlusIcon} from "./PlusIcon";
-import {VerticalDotsIcon} from "./VerticalDotsIcon";
-import {ChevronDownIcon} from "./ChevronDownIcon";
-import {SearchIcon} from "./SearchIcon";
-import {columns, users, statusOptions} from "./data";
-import {capitalize} from "./utils";
-
-const statusColorMap: Record = {
- active: "success",
- paused: "danger",
- vacation: "warning",
-};
-
-const INITIAL_VISIBLE_COLUMNS = ["name", "role", "status", "actions"];
-
-type User = typeof users[0];
-
-export default function App() {
- const [filterValue, setFilterValue] = React.useState("");
- const [selectedKeys, setSelectedKeys] = React.useState(new Set([]));
- const [visibleColumns, setVisibleColumns] = React.useState(new Set(INITIAL_VISIBLE_COLUMNS));
- const [statusFilter, setStatusFilter] = React.useState("all");
- const [rowsPerPage, setRowsPerPage] = React.useState(5);
- const [sortDescriptor, setSortDescriptor] = React.useState({
- column: "age",
- direction: "ascending",
- });
-
- const [page, setPage] = React.useState(1);
-
- const hasSearchFilter = Boolean(filterValue);
-
- const headerColumns = React.useMemo(() => {
- if (visibleColumns === "all") return columns;
-
- return columns.filter((column) => Array.from(visibleColumns).includes(column.uid));
- }, [visibleColumns]);
-
- const filteredItems = React.useMemo(() => {
- let filteredUsers = [...users];
-
- if (hasSearchFilter) {
- filteredUsers = filteredUsers.filter((user) =>
- user.name.toLowerCase().includes(filterValue.toLowerCase()),
- );
- }
- if (statusFilter !== "all" && Array.from(statusFilter).length !== statusOptions.length) {
- filteredUsers = filteredUsers.filter((user) =>
- Array.from(statusFilter).includes(user.status),
- );
- }
-
- return filteredUsers;
- }, [users, filterValue, statusFilter]);
-
- const pages = Math.ceil(filteredItems.length / rowsPerPage);
-
- const items = React.useMemo(() => {
- const start = (page - 1) * rowsPerPage;
- const end = start + rowsPerPage;
-
- return filteredItems.slice(start, end);
- }, [page, filteredItems, rowsPerPage]);
-
- const sortedItems = React.useMemo(() => {
- return [...items].sort((a: User, b: User) => {
- const first = a[sortDescriptor.column as keyof User] as number;
- const second = b[sortDescriptor.column as keyof User] as number;
- const cmp = first < second ? -1 : first > second ? 1 : 0;
-
- return sortDescriptor.direction === "descending" ? -cmp : cmp;
- });
- }, [sortDescriptor, items]);
-
- const renderCell = React.useCallback((user: User, columnKey: React.Key) => {
- const cellValue = user[columnKey as keyof User];
-
- switch (columnKey) {
- case "name":
- return (
-
- {user.email}
-
- );
- case "role":
- return (
-
-
{cellValue}
-
{user.team}
-
- );
- case "status":
- return (
-
- {cellValue}
-
- );
- case "actions":
- return (
-
-
-
-
-
-
-
-
- View
- Edit
- Delete
-
-
-
- );
- default:
- return cellValue;
- }
- }, []);
-
- const onNextPage = React.useCallback(() => {
- if (page < pages) {
- setPage(page + 1);
- }
- }, [page, pages]);
-
- const onPreviousPage = React.useCallback(() => {
- if (page > 1) {
- setPage(page - 1);
- }
- }, [page]);
-
- const onRowsPerPageChange = React.useCallback((e: React.ChangeEvent) => {
- setRowsPerPage(Number(e.target.value));
- setPage(1);
- }, []);
-
- const onSearchChange = React.useCallback((value?: string) => {
- if (value) {
- setFilterValue(value);
- setPage(1);
- } else {
- setFilterValue("");
- }
- }, []);
-
- const onClear = React.useCallback(()=>{
- setFilterValue("")
- setPage(1)
- },[])
-
- const topContent = React.useMemo(() => {
- return (
-
-
-
}
- value={filterValue}
- onClear={() => onClear()}
- onValueChange={onSearchChange}
- />
-
-
-
- } variant="flat">
- Status
-
-
-
- {statusOptions.map((status) => (
-
- {capitalize(status.name)}
-
- ))}
-
-
-
-
- } variant="flat">
- Columns
-
-
-
- {columns.map((column) => (
-
- {capitalize(column.name)}
-
- ))}
-
-
- }>
- Add New
-
-
-
-
- Total {users.length} users
-
- Rows per page:
-
- 5
- 10
- 15
-
-
-
-
- );
- }, [
- filterValue,
- statusFilter,
- visibleColumns,
- onSearchChange,
- onRowsPerPageChange,
- users.length,
- hasSearchFilter,
- ]);
-
- const bottomContent = React.useMemo(() => {
- return (
-
-
- {selectedKeys === "all"
- ? "All items selected"
- : \`\${selectedKeys.size} of \${filteredItems.length} selected\`}
-
-
-
-
- Previous
-
-
- Next
-
-
-
- );
- }, [selectedKeys, items.length, page, pages, hasSearchFilter]);
-
- return (
-
-
- {(column) => (
-
- {column.name}
-
- )}
-
-
- {(item) => (
-
- {(columnKey) => {renderCell(item, columnKey)} }
-
- )}
-
-
- );
-}`;
+import App from "./use-case.raw.jsx?raw";
+import AppTs from "./use-case.raw.tsx?raw";
const react = {
"/App.jsx": App,
- "/data.js": data,
- "/utils.js": utils,
- "/PlusIcon.jsx": PlusIcon,
- "/SearchIcon.jsx": SearchIcon,
- "/ChevronDownIcon.jsx": ChevronDownIcon,
- "/VerticalDotsIcon.jsx": VerticalDotsIcon,
};
const reactTs = {
"/App.tsx": AppTs,
- "/types.ts": types,
- "/data.ts": dataTs,
- "/utils.ts": utilsTs,
- "/PlusIcon.tsx": PlusIconTs,
- "/VerticalDotsIcon.tsx": VerticalDotsIconTs,
- "/SearchIcon.tsx": SearchIconTs,
- "/ChevronDownIcon.tsx": ChevronDownIconTs,
};
export default {
diff --git a/apps/docs/content/components/table/without-header.raw.jsx b/apps/docs/content/components/table/without-header.raw.jsx
new file mode 100644
index 0000000000..e5506cc19f
--- /dev/null
+++ b/apps/docs/content/components/table/without-header.raw.jsx
@@ -0,0 +1,35 @@
+import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/without-header.ts b/apps/docs/content/components/table/without-header.ts
index 18c4b55d98..90f0321bcc 100644
--- a/apps/docs/content/components/table/without-header.ts
+++ b/apps/docs/content/components/table/without-header.ts
@@ -1,38 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
- );
-}`;
+import App from "./without-header.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/table/without-wrapper.raw.jsx b/apps/docs/content/components/table/without-wrapper.raw.jsx
new file mode 100644
index 0000000000..26d6e38715
--- /dev/null
+++ b/apps/docs/content/components/table/without-wrapper.raw.jsx
@@ -0,0 +1,35 @@
+import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+ NAME
+ ROLE
+ STATUS
+
+
+
+ Tony Reichert
+ CEO
+ Active
+
+
+ Zoey Lang
+ Technical Lead
+ Paused
+
+
+ Jane Fisher
+ Senior Developer
+ Active
+
+
+ William Howard
+ Community Manager
+ Vacation
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/table/without-wrapper.ts b/apps/docs/content/components/table/without-wrapper.ts
index 74e22f5a2a..326e580709 100644
--- a/apps/docs/content/components/table/without-wrapper.ts
+++ b/apps/docs/content/components/table/without-wrapper.ts
@@ -1,38 +1,4 @@
-const App = `import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
- NAME
- ROLE
- STATUS
-
-
-
- Tony Reichert
- CEO
- Active
-
-
- Zoey Lang
- Technical Lead
- Paused
-
-
- Jane Fisher
- Senior Developer
- Active
-
-
- William Howard
- Community Manager
- Vacation
-
-
-
- );
-}`;
+import App from "./without-wrapper.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/colors.raw.jsx b/apps/docs/content/components/tabs/colors.raw.jsx
new file mode 100644
index 0000000000..38163ff07a
--- /dev/null
+++ b/apps/docs/content/components/tabs/colors.raw.jsx
@@ -0,0 +1,17 @@
+import {Tabs, Tab} from "@nextui-org/react";
+
+export default function App() {
+ const colors = ["default", "primary", "secondary", "success", "warning", "danger"];
+
+ return (
+
+ {colors.map((color) => (
+
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/colors.ts b/apps/docs/content/components/tabs/colors.ts
index ff9140ba8b..d5bef810aa 100644
--- a/apps/docs/content/components/tabs/colors.ts
+++ b/apps/docs/content/components/tabs/colors.ts
@@ -1,27 +1,4 @@
-const App = `import {Tabs, Tab} from "@nextui-org/react";
-
-export default function App() {
- const colors = [
- "default",
- "primary",
- "secondary",
- "success",
- "warning",
- "danger"
- ];
-
- return (
-
- {colors.map((color) => (
-
-
-
-
-
- ))}
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/controlled.raw.jsx b/apps/docs/content/components/tabs/controlled.raw.jsx
new file mode 100644
index 0000000000..9038268ef4
--- /dev/null
+++ b/apps/docs/content/components/tabs/controlled.raw.jsx
@@ -0,0 +1,38 @@
+import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ const [selected, setSelected] = React.useState("photos");
+
+ return (
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/controlled.ts b/apps/docs/content/components/tabs/controlled.ts
index 54ae1ee402..2c3f0cacb4 100644
--- a/apps/docs/content/components/tabs/controlled.ts
+++ b/apps/docs/content/components/tabs/controlled.ts
@@ -1,40 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- const [selected, setSelected] = React.useState("photos");
-
- return (
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
- );
-}`;
+import App from "./controlled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/custom-styles.raw.jsx b/apps/docs/content/components/tabs/custom-styles.raw.jsx
new file mode 100644
index 0000000000..d245ce75df
--- /dev/null
+++ b/apps/docs/content/components/tabs/custom-styles.raw.jsx
@@ -0,0 +1,131 @@
+import {Tabs, Tab, Chip} from "@nextui-org/react";
+
+export const GalleryIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export const MusicIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export const VideoIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+
+
+
+
+ Photos
+
+ 9
+
+
+ }
+ />
+
+
+ Music
+
+ 3
+
+
+ }
+ />
+
+
+ Videos
+
+ 1
+
+
+ }
+ />
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/custom-styles.ts b/apps/docs/content/components/tabs/custom-styles.ts
index ff197991d6..da3ea9093a 100644
--- a/apps/docs/content/components/tabs/custom-styles.ts
+++ b/apps/docs/content/components/tabs/custom-styles.ts
@@ -1,113 +1,7 @@
-const GalleryIcon = `export const GalleryIcon = (props) => (
-
-
-
-
-
-);`;
-
-const MusicIcon = `export const MusicIcon = (props) => (
-
-
-
-
-);`;
-
-const VideoIcon = `export const VideoIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {Tabs, Tab, Chip} from "@nextui-org/react";
-import {GalleryIcon} from "./GalleryIcon";
-import {MusicIcon} from "./MusicIcon";
-import {VideoIcon} from "./VideoIcon";
-
-export default function App() {
- return (
-
-
-
-
- Photos
- 9
-
- }
- />
-
-
- Music
- 3
-
- }
- />
-
-
- Videos
- 1
-
- }
- />
-
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/GalleryIcon.jsx": GalleryIcon,
- "/MusicIcon.jsx": MusicIcon,
- "/VideoIcon.jsx": VideoIcon,
};
export default {
diff --git a/apps/docs/content/components/tabs/disabled-item.raw.jsx b/apps/docs/content/components/tabs/disabled-item.raw.jsx
new file mode 100644
index 0000000000..36b3b20580
--- /dev/null
+++ b/apps/docs/content/components/tabs/disabled-item.raw.jsx
@@ -0,0 +1,36 @@
+import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/disabled-item.ts b/apps/docs/content/components/tabs/disabled-item.ts
index 9106c67548..90d0beb6b7 100644
--- a/apps/docs/content/components/tabs/disabled-item.ts
+++ b/apps/docs/content/components/tabs/disabled-item.ts
@@ -1,34 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
- );
-}`;
+import App from "./disabled-item.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/disabled.raw.jsx b/apps/docs/content/components/tabs/disabled.raw.jsx
new file mode 100644
index 0000000000..d37812b165
--- /dev/null
+++ b/apps/docs/content/components/tabs/disabled.raw.jsx
@@ -0,0 +1,36 @@
+import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/disabled.ts b/apps/docs/content/components/tabs/disabled.ts
index 4e5449d763..1a215cc91f 100644
--- a/apps/docs/content/components/tabs/disabled.ts
+++ b/apps/docs/content/components/tabs/disabled.ts
@@ -1,34 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
- );
-}`;
+import App from "./disabled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/dynamic.raw.jsx b/apps/docs/content/components/tabs/dynamic.raw.jsx
new file mode 100644
index 0000000000..53570bebfe
--- /dev/null
+++ b/apps/docs/content/components/tabs/dynamic.raw.jsx
@@ -0,0 +1,38 @@
+import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ let tabs = [
+ {
+ id: "photos",
+ label: "Photos",
+ content:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
+ },
+ {
+ id: "music",
+ label: "Music",
+ content:
+ "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
+ },
+ {
+ id: "videos",
+ label: "Videos",
+ content:
+ "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
+ },
+ ];
+
+ return (
+
+
+ {(item) => (
+
+
+ {item.content}
+
+
+ )}
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/dynamic.ts b/apps/docs/content/components/tabs/dynamic.ts
index 3e13d8eab0..5d3c97bb9a 100644
--- a/apps/docs/content/components/tabs/dynamic.ts
+++ b/apps/docs/content/components/tabs/dynamic.ts
@@ -1,40 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- let tabs = [
- {
- id: "photos",
- label: "Photos",
- content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
- },
- {
- id: "music",
- label: "Music",
- content: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
- },
- {
- id: "videos",
- label: "Videos",
- content: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
- }
- ];
-
- return (
-
-
- {(item) => (
-
-
-
- {item.content}
-
-
-
- )}
-
-
- );
-}`;
+import App from "./dynamic.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/form.raw.jsx b/apps/docs/content/components/tabs/form.raw.jsx
new file mode 100644
index 0000000000..61422dd9fa
--- /dev/null
+++ b/apps/docs/content/components/tabs/form.raw.jsx
@@ -0,0 +1,67 @@
+import {Tabs, Tab, Input, Link, Button, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ const [selected, setSelected] = React.useState("login");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/form.raw.tsx b/apps/docs/content/components/tabs/form.raw.tsx
new file mode 100644
index 0000000000..1e3e7f4c79
--- /dev/null
+++ b/apps/docs/content/components/tabs/form.raw.tsx
@@ -0,0 +1,68 @@
+import React from "react";
+import {Tabs, Tab, Input, Link, Button, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ const [selected, setSelected] = React.useState("login");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/form.ts b/apps/docs/content/components/tabs/form.ts
index 679964350b..2f8c0d8490 100644
--- a/apps/docs/content/components/tabs/form.ts
+++ b/apps/docs/content/components/tabs/form.ts
@@ -1,138 +1,5 @@
-const App = `import {Tabs, Tab, Input, Link, Button, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- const [selected, setSelected] = React.useState("login");
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}`;
-
-const AppTs = `import {Tabs, Tab, Input, Link, Button, Card, CardBody, CardHeader} from "@nextui-org/react";
-
-export default function App() {
- const [selected, setSelected] = React.useState("login");
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}`;
+import App from "./form.raw.jsx?raw";
+import AppTs from "./form.raw.tsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/icons.raw.jsx b/apps/docs/content/components/tabs/icons.raw.jsx
new file mode 100644
index 0000000000..17bca089e6
--- /dev/null
+++ b/apps/docs/content/components/tabs/icons.raw.jsx
@@ -0,0 +1,112 @@
+import {Tabs, Tab} from "@nextui-org/react";
+
+export const GalleryIcon = (props) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export const MusicIcon = (props) => {
+ return (
+
+
+
+
+ );
+};
+
+export const VideoIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+
+
+
+
+ Photos
+
+ }
+ />
+
+
+ Music
+
+ }
+ />
+
+
+ Videos
+
+ }
+ />
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/icons.ts b/apps/docs/content/components/tabs/icons.ts
index b272ee4257..22a410c88f 100644
--- a/apps/docs/content/components/tabs/icons.ts
+++ b/apps/docs/content/components/tabs/icons.ts
@@ -1,100 +1,7 @@
-const GalleryIcon = `export const GalleryIcon = (props) => (
-
-
-
-
-
-);`;
-
-const MusicIcon = `export const MusicIcon = (props) => (
-
-
-
-
-);`;
-
-const VideoIcon = `export const VideoIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {Tabs, Tab} from "@nextui-org/react";
-import {GalleryIcon} from "./GalleryIcon";
-import {MusicIcon} from "./MusicIcon";
-import {VideoIcon} from "./VideoIcon";
-
-export default function App() {
- return (
-
-
-
-
- Photos
-
- }
- />
-
-
- Music
-
- }
- />
-
-
- Videos
-
- }
- />
-
-
- );
-}`;
+import App from "./icons.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/GalleryIcon.jsx": GalleryIcon,
- "/MusicIcon.jsx": MusicIcon,
- "/VideoIcon.jsx": VideoIcon,
};
export default {
diff --git a/apps/docs/content/components/tabs/placement.raw.jsx b/apps/docs/content/components/tabs/placement.raw.jsx
new file mode 100644
index 0000000000..2fdc1e7578
--- /dev/null
+++ b/apps/docs/content/components/tabs/placement.raw.jsx
@@ -0,0 +1,51 @@
+import {Tabs, Tab, Card, CardBody, RadioGroup, Radio} from "@nextui-org/react";
+
+export default function App() {
+ const [placement, setPlacement] = React.useState("top");
+
+ return (
+
+
setPlacement(value)}
+ >
+ top
+ bottom
+ start
+ end
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
+ esse cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/placement.ts b/apps/docs/content/components/tabs/placement.ts
index 558a4bbdb5..eee2244366 100644
--- a/apps/docs/content/components/tabs/placement.ts
+++ b/apps/docs/content/components/tabs/placement.ts
@@ -1,48 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, RadioGroup, Radio} from "@nextui-org/react";
-
-export default function App() {
- const [placement, setPlacement] = React.useState("top");
- return (
-
-
setPlacement(value)}
- >
- top
- bottom
- start
- end
-
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
-
- );
-}`;
+import App from "./placement.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/radius.raw.jsx b/apps/docs/content/components/tabs/radius.raw.jsx
new file mode 100644
index 0000000000..0959a31088
--- /dev/null
+++ b/apps/docs/content/components/tabs/radius.raw.jsx
@@ -0,0 +1,17 @@
+import {Tabs, Tab} from "@nextui-org/react";
+
+export default function App() {
+ const radiusList = ["full", "lg", "md", "sm", "none"];
+
+ return (
+
+ {radiusList.map((radius) => (
+
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/radius.ts b/apps/docs/content/components/tabs/radius.ts
index 75c39db1d7..7b78db1ce0 100644
--- a/apps/docs/content/components/tabs/radius.ts
+++ b/apps/docs/content/components/tabs/radius.ts
@@ -1,26 +1,4 @@
-const App = `import {Tabs, Tab} from "@nextui-org/react";
-
-export default function App() {
- const radiusList = [
- "full",
- "lg",
- "md",
- "sm",
- "none",
- ];
-
- return (
-
- {radiusList.map((radius) => (
-
-
-
-
-
- ))}
-
- );
-}`;
+import App from "./radius.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/sizes.raw.jsx b/apps/docs/content/components/tabs/sizes.raw.jsx
new file mode 100644
index 0000000000..589d1a18a8
--- /dev/null
+++ b/apps/docs/content/components/tabs/sizes.raw.jsx
@@ -0,0 +1,17 @@
+import {Tabs, Tab} from "@nextui-org/react";
+
+export default function App() {
+ const sizes = ["sm", "md", "lg"];
+
+ return (
+
+ {sizes.map((size) => (
+
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/sizes.ts b/apps/docs/content/components/tabs/sizes.ts
index 9e20158653..85a2f5b30b 100644
--- a/apps/docs/content/components/tabs/sizes.ts
+++ b/apps/docs/content/components/tabs/sizes.ts
@@ -1,24 +1,4 @@
-const App = `import {Tabs, Tab} from "@nextui-org/react";
-
-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,
diff --git a/apps/docs/content/components/tabs/usage.raw.jsx b/apps/docs/content/components/tabs/usage.raw.jsx
new file mode 100644
index 0000000000..54c7a54cce
--- /dev/null
+++ b/apps/docs/content/components/tabs/usage.raw.jsx
@@ -0,0 +1,36 @@
+import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/usage.ts b/apps/docs/content/components/tabs/usage.ts
index 552e09828a..1118304c37 100644
--- a/apps/docs/content/components/tabs/usage.ts
+++ b/apps/docs/content/components/tabs/usage.ts
@@ -1,34 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/variants.raw.jsx b/apps/docs/content/components/tabs/variants.raw.jsx
new file mode 100644
index 0000000000..d63d01a387
--- /dev/null
+++ b/apps/docs/content/components/tabs/variants.raw.jsx
@@ -0,0 +1,17 @@
+import {Tabs, Tab} from "@nextui-org/react";
+
+export default function App() {
+ const variants = ["solid", "underlined", "bordered", "light"];
+
+ return (
+
+ {variants.map((variant) => (
+
+
+
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/variants.ts b/apps/docs/content/components/tabs/variants.ts
index 53c80deb2b..ddea95fb2e 100644
--- a/apps/docs/content/components/tabs/variants.ts
+++ b/apps/docs/content/components/tabs/variants.ts
@@ -1,25 +1,4 @@
-const App = `import {Tabs, Tab} from "@nextui-org/react";
-
-export default function App() {
- const variants = [
- "solid",
- "underlined",
- "bordered",
- "light",
- ];
-
- return (
-
- {variants.map((variant) => (
-
-
-
-
-
- ))}
-
- );
-}`;
+import App from "./variants.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tabs/vertical.raw.jsx b/apps/docs/content/components/tabs/vertical.raw.jsx
new file mode 100644
index 0000000000..b1229a8965
--- /dev/null
+++ b/apps/docs/content/components/tabs/vertical.raw.jsx
@@ -0,0 +1,43 @@
+import {Tabs, Tab, Card, CardBody, Switch} from "@nextui-org/react";
+
+export default function App() {
+ const [isVertical, setIsVertical] = React.useState(true);
+
+ return (
+
+
+ Vertical
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
+ esse cillum dolore eu fugiat nulla pariatur.
+
+
+
+
+
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tabs/vertical.ts b/apps/docs/content/components/tabs/vertical.ts
index 7487c22bb1..697ac10343 100644
--- a/apps/docs/content/components/tabs/vertical.ts
+++ b/apps/docs/content/components/tabs/vertical.ts
@@ -1,40 +1,4 @@
-const App = `import {Tabs, Tab, Card, CardBody, Switch} from "@nextui-org/react";
-
-export default function App() {
- const [isVertical, setIsVertical] = React.useState(true);
- return (
-
-
- Vertical
-
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
-
- );
-}`;
+import App from "./vertical.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/autosize.raw.jsx b/apps/docs/content/components/textarea/autosize.raw.jsx
new file mode 100644
index 0000000000..0addb39d70
--- /dev/null
+++ b/apps/docs/content/components/textarea/autosize.raw.jsx
@@ -0,0 +1,11 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/autosize.ts b/apps/docs/content/components/textarea/autosize.ts
index 55cb2402bd..b82782913b 100644
--- a/apps/docs/content/components/textarea/autosize.ts
+++ b/apps/docs/content/components/textarea/autosize.ts
@@ -1,25 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./autosize.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/clear-button.raw.jsx b/apps/docs/content/components/textarea/clear-button.raw.jsx
new file mode 100644
index 0000000000..6b496d70ec
--- /dev/null
+++ b/apps/docs/content/components/textarea/clear-button.raw.jsx
@@ -0,0 +1,16 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+