(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..1353c9b5e2
--- /dev/null
+++ b/apps/docs/content/components/select/async-loading-items.raw.tsx
@@ -0,0 +1,108 @@
+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) {
+ 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..b46f9def2c
--- /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 e57b2904e9..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]/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)} }
-
- )}
-
-
- );
-}`;
-
-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]/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)} }
-
- )}
-
-
- );
-}`;
+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/controlled.raw.jsx b/apps/docs/content/components/textarea/controlled.raw.jsx
new file mode 100644
index 0000000000..13dba52da4
--- /dev/null
+++ b/apps/docs/content/components/textarea/controlled.raw.jsx
@@ -0,0 +1,19 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ const [value, setValue] = React.useState("");
+
+ return (
+
+
+
Textarea value: {value}
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/controlled.ts b/apps/docs/content/components/textarea/controlled.ts
index de68816041..2c3f0cacb4 100644
--- a/apps/docs/content/components/textarea/controlled.ts
+++ b/apps/docs/content/components/textarea/controlled.ts
@@ -1,22 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- const [value, setValue] = React.useState("");
-
- return (
-
-
-
Textarea value: {value}
-
- );
-}`;
+import App from "./controlled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/description.raw.jsx b/apps/docs/content/components/textarea/description.raw.jsx
new file mode 100644
index 0000000000..5db51b7747
--- /dev/null
+++ b/apps/docs/content/components/textarea/description.raw.jsx
@@ -0,0 +1,13 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/description.ts b/apps/docs/content/components/textarea/description.ts
index 2b37dda9e5..aeb6340b6b 100644
--- a/apps/docs/content/components/textarea/description.ts
+++ b/apps/docs/content/components/textarea/description.ts
@@ -1,16 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./description.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/disable-autosize.raw.jsx b/apps/docs/content/components/textarea/disable-autosize.raw.jsx
new file mode 100644
index 0000000000..78ddc14711
--- /dev/null
+++ b/apps/docs/content/components/textarea/disable-autosize.raw.jsx
@@ -0,0 +1,17 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/disable-autosize.ts b/apps/docs/content/components/textarea/disable-autosize.ts
index df63cc1165..5e50200f22 100644
--- a/apps/docs/content/components/textarea/disable-autosize.ts
+++ b/apps/docs/content/components/textarea/disable-autosize.ts
@@ -1,20 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./disable-autosize.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/disabled.raw.jsx b/apps/docs/content/components/textarea/disabled.raw.jsx
new file mode 100644
index 0000000000..832a627c1e
--- /dev/null
+++ b/apps/docs/content/components/textarea/disabled.raw.jsx
@@ -0,0 +1,14 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/disabled.ts b/apps/docs/content/components/textarea/disabled.ts
index 182b7b5ef0..1a215cc91f 100644
--- a/apps/docs/content/components/textarea/disabled.ts
+++ b/apps/docs/content/components/textarea/disabled.ts
@@ -1,17 +1,4 @@
-const App = `import {Textarea} 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/textarea/error-message.raw.jsx b/apps/docs/content/components/textarea/error-message.raw.jsx
new file mode 100644
index 0000000000..3a1c8f29bd
--- /dev/null
+++ b/apps/docs/content/components/textarea/error-message.raw.jsx
@@ -0,0 +1,15 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/error-message.ts b/apps/docs/content/components/textarea/error-message.ts
index 8a32c04ab9..fb8101b132 100644
--- a/apps/docs/content/components/textarea/error-message.ts
+++ b/apps/docs/content/components/textarea/error-message.ts
@@ -1,18 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./error-message.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/readonly.raw.jsx b/apps/docs/content/components/textarea/readonly.raw.jsx
new file mode 100644
index 0000000000..eb2e4d947e
--- /dev/null
+++ b/apps/docs/content/components/textarea/readonly.raw.jsx
@@ -0,0 +1,15 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/readonly.ts b/apps/docs/content/components/textarea/readonly.ts
index 1d66b78874..fabd05ba36 100644
--- a/apps/docs/content/components/textarea/readonly.ts
+++ b/apps/docs/content/components/textarea/readonly.ts
@@ -1,18 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./readonly.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/required.raw.jsx b/apps/docs/content/components/textarea/required.raw.jsx
new file mode 100644
index 0000000000..f07a31d38b
--- /dev/null
+++ b/apps/docs/content/components/textarea/required.raw.jsx
@@ -0,0 +1,13 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/required.ts b/apps/docs/content/components/textarea/required.ts
index 01126e7fef..b50b781e6f 100644
--- a/apps/docs/content/components/textarea/required.ts
+++ b/apps/docs/content/components/textarea/required.ts
@@ -1,16 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./required.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/textarea/usage.raw.jsx b/apps/docs/content/components/textarea/usage.raw.jsx
new file mode 100644
index 0000000000..bb911f295b
--- /dev/null
+++ b/apps/docs/content/components/textarea/usage.raw.jsx
@@ -0,0 +1,5 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/textarea/usage.ts b/apps/docs/content/components/textarea/usage.ts
index 53720f0660..1118304c37 100644
--- a/apps/docs/content/components/textarea/usage.ts
+++ b/apps/docs/content/components/textarea/usage.ts
@@ -1,14 +1,4 @@
-const App = `import {Textarea} 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/textarea/variants.raw.jsx b/apps/docs/content/components/textarea/variants.raw.jsx
new file mode 100644
index 0000000000..4128e5976a
--- /dev/null
+++ b/apps/docs/content/components/textarea/variants.raw.jsx
@@ -0,0 +1,20 @@
+import {Textarea} from "@nextui-org/react";
+
+export default function App() {
+ const variants = ["flat", "faded", "bordered", "underlined"];
+
+ return (
+
+ {variants.map((variant) => (
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/textarea/variants.ts b/apps/docs/content/components/textarea/variants.ts
index d20e30b3fa..ddea95fb2e 100644
--- a/apps/docs/content/components/textarea/variants.ts
+++ b/apps/docs/content/components/textarea/variants.ts
@@ -1,23 +1,4 @@
-const App = `import {Textarea} from "@nextui-org/react";
-
-export default function App() {
- const variants = ["flat", "faded", "bordered", "underlined"];
-
- return (
-
- {variants.map((variant) => (
-
- ))}
-
- );
-}`;
+import App from "./variants.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/controlled.raw.jsx b/apps/docs/content/components/time-input/controlled.raw.jsx
new file mode 100644
index 0000000000..a69bf472e2
--- /dev/null
+++ b/apps/docs/content/components/time-input/controlled.raw.jsx
@@ -0,0 +1,26 @@
+import {TimeInput} from "@nextui-org/react";
+import {parseAbsoluteToLocal, Time, ZonedDateTime} from "@internationalized/date";
+import {useDateFormatter} from "@react-aria/i18n";
+
+export default function App() {
+ let [value, setValue] = React.useState(parseAbsoluteToLocal("2024-04-08T18:45:22Z"));
+
+ let formatter = useDateFormatter({dateStyle: "short", timeStyle: "long"});
+
+ return (
+
+
+
+
+ {value instanceof ZonedDateTime
+ ? (value.toDate && formatter.format(value.toDate())) ||
+ (value && value.toString()) ||
+ "--"
+ : ""}
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/controlled.raw.tsx b/apps/docs/content/components/time-input/controlled.raw.tsx
new file mode 100644
index 0000000000..ebdaebaf7e
--- /dev/null
+++ b/apps/docs/content/components/time-input/controlled.raw.tsx
@@ -0,0 +1,31 @@
+import type {TimeInputValue} from "@nextui-org/react";
+
+import React from "react";
+import {TimeInput} from "@nextui-org/react";
+import {parseAbsoluteToLocal, Time, ZonedDateTime} from "@internationalized/date";
+import {useDateFormatter} from "@react-aria/i18n";
+
+export default function App() {
+ let [value, setValue] = React.useState(
+ parseAbsoluteToLocal("2024-04-08T18:45:22Z"),
+ );
+
+ let formatter = useDateFormatter({dateStyle: "short", timeStyle: "long"});
+
+ return (
+
+
+
+
+ {value instanceof ZonedDateTime
+ ? (value.toDate && formatter.format(value.toDate())) ||
+ (value && value.toString()) ||
+ "--"
+ : ""}
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/controlled.ts b/apps/docs/content/components/time-input/controlled.ts
index edde086089..1f1a363363 100644
--- a/apps/docs/content/components/time-input/controlled.ts
+++ b/apps/docs/content/components/time-input/controlled.ts
@@ -1,63 +1,15 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {parseAbsoluteToLocal, Time, ZonedDateTime} from "@internationalized/date";
-import {useDateFormatter} from "@react-aria/i18n";
-
-export default function App() {
- let [value, setValue] = React.useState(parseAbsoluteToLocal("2024-04-08T18:45:22Z"));
-
- let formatter = useDateFormatter({dateStyle: "short", timeStyle: "long"});
-
- return (
-
-
-
-
- {value instanceof ZonedDateTime
- ? (value.toDate && formatter.format(value.toDate())) ||
- (value && value.toString()) ||
- "--"
- : ""}
-
-
-
-
-
- );
-}`;
-
-const AppTs = `import {TimeInput} from "@nextui-org/react";
-import type {TimeValue} from "@react-types/datepicker";
-import {parseAbsoluteToLocal, Time, ZonedDateTime} from "@internationalized/date";
-import {useDateFormatter} from "@react-aria/i18n";
-
-export default function App() {
- let [value, setValue] = React.useState(parseAbsoluteToLocal("2024-04-08T18:45:22Z"));
-
- let formatter = useDateFormatter({dateStyle: "short", timeStyle: "long"});
-
- return (
-
-
-
-
- {value instanceof ZonedDateTime
- ? (value.toDate && formatter.format(value.toDate())) ||
- (value && value.toString()) ||
- "--"
- : ""}
-
-
-
-
-
- );
-}`;
+import App from "./controlled.raw.jsx?raw";
+import AppTs from "./controlled.raw.tsx?raw";
const react = {
"/App.jsx": App,
+};
+
+const reactTs = {
"/App.tsx": AppTs,
};
export default {
...react,
+ ...reactTs,
};
diff --git a/apps/docs/content/components/time-input/disabled.raw.jsx b/apps/docs/content/components/time-input/disabled.raw.jsx
new file mode 100644
index 0000000000..bc9f9a1af5
--- /dev/null
+++ b/apps/docs/content/components/time-input/disabled.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/disabled.ts b/apps/docs/content/components/time-input/disabled.ts
index c9b3cccae9..1a215cc91f 100644
--- a/apps/docs/content/components/time-input/disabled.ts
+++ b/apps/docs/content/components/time-input/disabled.ts
@@ -1,15 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./disabled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/end-content.raw.jsx b/apps/docs/content/components/time-input/end-content.raw.jsx
new file mode 100644
index 0000000000..fca3665b63
--- /dev/null
+++ b/apps/docs/content/components/time-input/end-content.raw.jsx
@@ -0,0 +1,35 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export const ClockCircleLinearIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+
+ }
+ label="Event Time"
+ labelPlacement="outside"
+ />
+ );
+}
diff --git a/apps/docs/content/components/time-input/end-content.ts b/apps/docs/content/components/time-input/end-content.ts
index a97f942a07..d9a1087e2b 100644
--- a/apps/docs/content/components/time-input/end-content.ts
+++ b/apps/docs/content/components/time-input/end-content.ts
@@ -1,41 +1,7 @@
-const ClockCircleLinearIcon = `export const ClockCircleLinearIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {TimeInput} from "@nextui-org/react";
-import {ClockCircleLinearIcon} from './ClockCircleLinearIcon';
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- )}
- />
- );
-}`;
+import App from "./end-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/ClockCircleLinearIcon.jsx": ClockCircleLinearIcon,
};
export default {
diff --git a/apps/docs/content/components/time-input/error-message-function.raw.jsx b/apps/docs/content/components/time-input/error-message-function.raw.jsx
new file mode 100644
index 0000000000..4c707d11f9
--- /dev/null
+++ b/apps/docs/content/components/time-input/error-message-function.raw.jsx
@@ -0,0 +1,15 @@
+import {TimeInput} from "@nextui-org/react";
+
+export default function App() {
+ return (
+ {
+ if (value.isInvalid) {
+ return "Please enter a valid time";
+ }
+ }}
+ label="Event Time"
+ />
+ );
+}
diff --git a/apps/docs/content/components/time-input/error-message-function.ts b/apps/docs/content/components/time-input/error-message-function.ts
index b8111e5265..1af0006141 100644
--- a/apps/docs/content/components/time-input/error-message-function.ts
+++ b/apps/docs/content/components/time-input/error-message-function.ts
@@ -1,18 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-
-export default function App() {
- return (
- {
- if (value.isInvalid) {
- return "Please enter a valid time";
- }
- }}
- />
- );
-}`;
+import App from "./error-message-function.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/error-message.raw.jsx b/apps/docs/content/components/time-input/error-message.raw.jsx
new file mode 100644
index 0000000000..e9637a0a04
--- /dev/null
+++ b/apps/docs/content/components/time-input/error-message.raw.jsx
@@ -0,0 +1,5 @@
+import {TimeInput} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/error-message.ts b/apps/docs/content/components/time-input/error-message.ts
index 8d60a11647..fb8101b132 100644
--- a/apps/docs/content/components/time-input/error-message.ts
+++ b/apps/docs/content/components/time-input/error-message.ts
@@ -1,14 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./error-message.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/granularity.raw.jsx b/apps/docs/content/components/time-input/granularity.raw.jsx
new file mode 100644
index 0000000000..e1fa5ec73f
--- /dev/null
+++ b/apps/docs/content/components/time-input/granularity.raw.jsx
@@ -0,0 +1,14 @@
+import {TimeInput} from "@nextui-org/react";
+import {parseAbsoluteToLocal} from "@internationalized/date";
+
+export default function App() {
+ let [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/granularity.raw.tsx b/apps/docs/content/components/time-input/granularity.raw.tsx
new file mode 100644
index 0000000000..963745608a
--- /dev/null
+++ b/apps/docs/content/components/time-input/granularity.raw.tsx
@@ -0,0 +1,19 @@
+import type {TimeInputValue} from "@nextui-org/react";
+
+import React from "react";
+import {TimeInput} from "@nextui-org/react";
+import {parseAbsoluteToLocal} from "@internationalized/date";
+
+export default function App() {
+ let [date, setDate] = React.useState(
+ parseAbsoluteToLocal("2021-04-07T18:45:22Z"),
+ );
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/granularity.ts b/apps/docs/content/components/time-input/granularity.ts
index e7d333d1bb..6196832da6 100644
--- a/apps/docs/content/components/time-input/granularity.ts
+++ b/apps/docs/content/components/time-input/granularity.ts
@@ -1,39 +1,15 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time, parseAbsoluteToLocal} from "@internationalized/date";
-
-export default function App() {
- let [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
-
- return (
-
-
-
-
-
- );
-}`;
-
-const AppTs = `import {TimeInput} from "@nextui-org/react";
-import type {TimeValue} from "@react-types/datepicker";
-import {Time, parseAbsoluteToLocal} from "@internationalized/date";
-
-export default function App() {
- let [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
-
- return (
-
-
-
-
-
- );
-}`;
+import App from "./granularity.raw.jsx?raw";
+import AppTs from "./granularity.raw.tsx?raw";
const react = {
"/App.jsx": App,
+};
+
+const reactTs = {
"/App.tsx": AppTs,
};
export default {
...react,
+ ...reactTs,
};
diff --git a/apps/docs/content/components/time-input/hide-timezone.raw.jsx b/apps/docs/content/components/time-input/hide-timezone.raw.jsx
new file mode 100644
index 0000000000..3539b9d74e
--- /dev/null
+++ b/apps/docs/content/components/time-input/hide-timezone.raw.jsx
@@ -0,0 +1,12 @@
+import {TimeInput} from "@nextui-org/react";
+import {parseZonedDateTime} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/hide-timezone.ts b/apps/docs/content/components/time-input/hide-timezone.ts
index 3f40c75747..225f731355 100644
--- a/apps/docs/content/components/time-input/hide-timezone.ts
+++ b/apps/docs/content/components/time-input/hide-timezone.ts
@@ -1,15 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {parseZonedDateTime} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./hide-timezone.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/hour-cycle.raw.jsx b/apps/docs/content/components/time-input/hour-cycle.raw.jsx
new file mode 100644
index 0000000000..16d4bb4ca0
--- /dev/null
+++ b/apps/docs/content/components/time-input/hour-cycle.raw.jsx
@@ -0,0 +1,13 @@
+import {TimeInput} from "@nextui-org/react";
+import {parseZonedDateTime} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/hour-cycle.ts b/apps/docs/content/components/time-input/hour-cycle.ts
index 2eb449f7cc..67ba87ab26 100644
--- a/apps/docs/content/components/time-input/hour-cycle.ts
+++ b/apps/docs/content/components/time-input/hour-cycle.ts
@@ -1,16 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time, parseZonedDateTime} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./hour-cycle.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/label-placement.raw.jsx b/apps/docs/content/components/time-input/label-placement.raw.jsx
new file mode 100644
index 0000000000..3df0a5f3c7
--- /dev/null
+++ b/apps/docs/content/components/time-input/label-placement.raw.jsx
@@ -0,0 +1,27 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/label-placement.ts b/apps/docs/content/components/time-input/label-placement.ts
index d76a98f8e9..ef98ce0f52 100644
--- a/apps/docs/content/components/time-input/label-placement.ts
+++ b/apps/docs/content/components/time-input/label-placement.ts
@@ -1,30 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
-
-
-
-
- );
-}`;
+import App from "./label-placement.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/max-time-value.raw.jsx b/apps/docs/content/components/time-input/max-time-value.raw.jsx
new file mode 100644
index 0000000000..044979b4a1
--- /dev/null
+++ b/apps/docs/content/components/time-input/max-time-value.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/max-time-value.ts b/apps/docs/content/components/time-input/max-time-value.ts
index 711a1d7268..cdef4055ac 100644
--- a/apps/docs/content/components/time-input/max-time-value.ts
+++ b/apps/docs/content/components/time-input/max-time-value.ts
@@ -1,14 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./max-time-value.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/min-time-value.raw.jsx b/apps/docs/content/components/time-input/min-time-value.raw.jsx
new file mode 100644
index 0000000000..e60b5e8366
--- /dev/null
+++ b/apps/docs/content/components/time-input/min-time-value.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/min-time-value.ts b/apps/docs/content/components/time-input/min-time-value.ts
index be780a3fbf..1671f69992 100644
--- a/apps/docs/content/components/time-input/min-time-value.ts
+++ b/apps/docs/content/components/time-input/min-time-value.ts
@@ -1,14 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./min-time-value.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/placeholder-value.raw.jsx b/apps/docs/content/components/time-input/placeholder-value.raw.jsx
new file mode 100644
index 0000000000..49f5a6e491
--- /dev/null
+++ b/apps/docs/content/components/time-input/placeholder-value.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/placeholder-value.ts b/apps/docs/content/components/time-input/placeholder-value.ts
index 7f329f9470..d9398c975b 100644
--- a/apps/docs/content/components/time-input/placeholder-value.ts
+++ b/apps/docs/content/components/time-input/placeholder-value.ts
@@ -1,14 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./placeholder-value.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/read-only.raw.jsx b/apps/docs/content/components/time-input/read-only.raw.jsx
new file mode 100644
index 0000000000..d07fef7d71
--- /dev/null
+++ b/apps/docs/content/components/time-input/read-only.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/read-only.ts b/apps/docs/content/components/time-input/read-only.ts
index 15d54d38fb..caf4be10cf 100644
--- a/apps/docs/content/components/time-input/read-only.ts
+++ b/apps/docs/content/components/time-input/read-only.ts
@@ -1,15 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} 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/time-input/required.raw.jsx b/apps/docs/content/components/time-input/required.raw.jsx
new file mode 100644
index 0000000000..b98dedca29
--- /dev/null
+++ b/apps/docs/content/components/time-input/required.raw.jsx
@@ -0,0 +1,5 @@
+import {TimeInput} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/required.ts b/apps/docs/content/components/time-input/required.ts
index 33a1e7e0ac..b50b781e6f 100644
--- a/apps/docs/content/components/time-input/required.ts
+++ b/apps/docs/content/components/time-input/required.ts
@@ -1,13 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./required.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/start-content.raw.jsx b/apps/docs/content/components/time-input/start-content.raw.jsx
new file mode 100644
index 0000000000..6f5dcd18cb
--- /dev/null
+++ b/apps/docs/content/components/time-input/start-content.raw.jsx
@@ -0,0 +1,35 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export const ClockCircleLinearIcon = (props) => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default function App() {
+ return (
+
+ }
+ />
+ );
+}
diff --git a/apps/docs/content/components/time-input/start-content.ts b/apps/docs/content/components/time-input/start-content.ts
index bf5c488177..59191d72a7 100644
--- a/apps/docs/content/components/time-input/start-content.ts
+++ b/apps/docs/content/components/time-input/start-content.ts
@@ -1,41 +1,7 @@
-const ClockCircleLinearIcon = `export const ClockCircleLinearIcon = (props) => (
-
-
-
-
-
-
-);`;
-
-const App = `import {TimeInput} from "@nextui-org/react";
-import {ClockCircleLinearIcon} from './ClockCircleLinearIcon';
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- )}
- />
- );
-}`;
+import App from "./start-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
- "/ClockCircleLinearIcon.jsx": ClockCircleLinearIcon,
};
export default {
diff --git a/apps/docs/content/components/time-input/timezones.raw.jsx b/apps/docs/content/components/time-input/timezones.raw.jsx
new file mode 100644
index 0000000000..17b22a81be
--- /dev/null
+++ b/apps/docs/content/components/time-input/timezones.raw.jsx
@@ -0,0 +1,17 @@
+import {TimeInput} from "@nextui-org/react";
+import {parseZonedDateTime, parseAbsoluteToLocal} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/timezones.ts b/apps/docs/content/components/time-input/timezones.ts
index 7faa8d00c7..d13be3f87a 100644
--- a/apps/docs/content/components/time-input/timezones.ts
+++ b/apps/docs/content/components/time-input/timezones.ts
@@ -1,20 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time, parseZonedDateTime, parseAbsoluteToLocal} from "@internationalized/date";
-
-export default function App() {
- return (
-
-
-
-
- );
-}`;
+import App from "./timezones.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/usage.raw.jsx b/apps/docs/content/components/time-input/usage.raw.jsx
new file mode 100644
index 0000000000..62d5a1d9bc
--- /dev/null
+++ b/apps/docs/content/components/time-input/usage.raw.jsx
@@ -0,0 +1,11 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/time-input/usage.ts b/apps/docs/content/components/time-input/usage.ts
index 4953e39fde..1118304c37 100644
--- a/apps/docs/content/components/time-input/usage.ts
+++ b/apps/docs/content/components/time-input/usage.ts
@@ -1,14 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} 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/time-input/with-description.raw.jsx b/apps/docs/content/components/time-input/with-description.raw.jsx
new file mode 100644
index 0000000000..7c086bdda5
--- /dev/null
+++ b/apps/docs/content/components/time-input/with-description.raw.jsx
@@ -0,0 +1,5 @@
+import {TimeInput} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/with-description.ts b/apps/docs/content/components/time-input/with-description.ts
index faf8b757aa..d42b2150ff 100644
--- a/apps/docs/content/components/time-input/with-description.ts
+++ b/apps/docs/content/components/time-input/with-description.ts
@@ -1,13 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./with-description.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/time-input/without-label.raw.jsx b/apps/docs/content/components/time-input/without-label.raw.jsx
new file mode 100644
index 0000000000..94f1a44d9e
--- /dev/null
+++ b/apps/docs/content/components/time-input/without-label.raw.jsx
@@ -0,0 +1,6 @@
+import {TimeInput} from "@nextui-org/react";
+import {Time} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/time-input/without-label.ts b/apps/docs/content/components/time-input/without-label.ts
index 88f073e25e..f6109b3984 100644
--- a/apps/docs/content/components/time-input/without-label.ts
+++ b/apps/docs/content/components/time-input/without-label.ts
@@ -1,11 +1,4 @@
-const App = `import {TimeInput} from "@nextui-org/react";
-import {Time} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./without-label.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/arrow.raw.jsx b/apps/docs/content/components/tooltip/arrow.raw.jsx
new file mode 100644
index 0000000000..f1b195d705
--- /dev/null
+++ b/apps/docs/content/components/tooltip/arrow.raw.jsx
@@ -0,0 +1,9 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Hover me
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/arrow.ts b/apps/docs/content/components/tooltip/arrow.ts
index d7afa75e90..d04dbb0e9d 100644
--- a/apps/docs/content/components/tooltip/arrow.ts
+++ b/apps/docs/content/components/tooltip/arrow.ts
@@ -1,12 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Hover me
-
- );
-}`;
+import App from "./arrow.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/colors.raw.jsx b/apps/docs/content/components/tooltip/colors.raw.jsx
new file mode 100644
index 0000000000..37cbf76f7c
--- /dev/null
+++ b/apps/docs/content/components/tooltip/colors.raw.jsx
@@ -0,0 +1,19 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ const colors = ["default", "primary", "secondary", "success", "warning", "danger", "foreground"];
+
+ return (
+
+ {colors.map((color) => {
+ return (
+
+
+ {color}
+
+
+ );
+ })}
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/colors.ts b/apps/docs/content/components/tooltip/colors.ts
index bbdb3a5d4a..d5bef810aa 100644
--- a/apps/docs/content/components/tooltip/colors.ts
+++ b/apps/docs/content/components/tooltip/colors.ts
@@ -1,30 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- const colors = [
- "default",
- "primary",
- "secondary",
- "success",
- "warning",
- "danger",
- "foreground",
- ];
-
- return (
-
- {colors.map((color) => {
- return (
-
-
- {color}
-
-
- )
- })}
-
- );
-}`;
+import App from "./colors.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/controlled.raw.jsx b/apps/docs/content/components/tooltip/controlled.raw.jsx
new file mode 100644
index 0000000000..ea799c2c5e
--- /dev/null
+++ b/apps/docs/content/components/tooltip/controlled.raw.jsx
@@ -0,0 +1,14 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ const [isOpen, setIsOpen] = React.useState(false);
+
+ return (
+
+
setIsOpen(open)}>
+ Hover me
+
+
Open: {isOpen ? "true" : "false"}
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/controlled.ts b/apps/docs/content/components/tooltip/controlled.ts
index 4895d8a455..2c3f0cacb4 100644
--- a/apps/docs/content/components/tooltip/controlled.ts
+++ b/apps/docs/content/components/tooltip/controlled.ts
@@ -1,23 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- const [isOpen, setIsOpen] = React.useState(false);
-
- return (
-
-
setIsOpen(open)}
- content="I am a tooltip"
- >
- Hover me
-
-
- Open: {isOpen ? "true" : "false"}
-
-
- );
-}`;
+import App from "./controlled.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/custom-content.raw.jsx b/apps/docs/content/components/tooltip/custom-content.raw.jsx
new file mode 100644
index 0000000000..0108f8e58f
--- /dev/null
+++ b/apps/docs/content/components/tooltip/custom-content.raw.jsx
@@ -0,0 +1,16 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Custom Content
+ This is a custom tooltip content
+
+ }
+ >
+ Hover me
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/custom-content.ts b/apps/docs/content/components/tooltip/custom-content.ts
index a8f62d64c0..6860587a71 100644
--- a/apps/docs/content/components/tooltip/custom-content.ts
+++ b/apps/docs/content/components/tooltip/custom-content.ts
@@ -1,21 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Custom Content
- This is a custom tooltip content
-
- }
- >
-
- Hover me
-
-
- );
-}`;
+import App from "./custom-content.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/custom-motion.raw.jsx b/apps/docs/content/components/tooltip/custom-motion.raw.jsx
new file mode 100644
index 0000000000..475cff9379
--- /dev/null
+++ b/apps/docs/content/components/tooltip/custom-motion.raw.jsx
@@ -0,0 +1,31 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Hover me
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/custom-motion.ts b/apps/docs/content/components/tooltip/custom-motion.ts
index dd7ec56f39..389f462ddd 100644
--- a/apps/docs/content/components/tooltip/custom-motion.ts
+++ b/apps/docs/content/components/tooltip/custom-motion.ts
@@ -1,34 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Hover me
-
- );
-}`;
+import App from "./custom-motion.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/custom-styles.raw.jsx b/apps/docs/content/components/tooltip/custom-styles.raw.jsx
new file mode 100644
index 0000000000..96dbff1c1b
--- /dev/null
+++ b/apps/docs/content/components/tooltip/custom-styles.raw.jsx
@@ -0,0 +1,20 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Hover me
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/custom-styles.ts b/apps/docs/content/components/tooltip/custom-styles.ts
index d72ba52213..da3ea9093a 100644
--- a/apps/docs/content/components/tooltip/custom-styles.ts
+++ b/apps/docs/content/components/tooltip/custom-styles.ts
@@ -1,26 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Hover me
-
- );
-}`;
+import App from "./custom-styles.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/delay-multiple.raw.jsx b/apps/docs/content/components/tooltip/delay-multiple.raw.jsx
new file mode 100644
index 0000000000..c9acae2b11
--- /dev/null
+++ b/apps/docs/content/components/tooltip/delay-multiple.raw.jsx
@@ -0,0 +1,18 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+ Hover me (delay 1000ms)
+
+
+
+
+ Then hover me
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/delay-multiple.ts b/apps/docs/content/components/tooltip/delay-multiple.ts
index 71336f2312..c9f4aabd4d 100644
--- a/apps/docs/content/components/tooltip/delay-multiple.ts
+++ b/apps/docs/content/components/tooltip/delay-multiple.ts
@@ -1,21 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
- Hover me (delay 1000ms)
-
-
-
-
- Then hover me
-
-
-
- );
-}`;
+import App from "./delay-multiple.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/delay.raw.jsx b/apps/docs/content/components/tooltip/delay.raw.jsx
new file mode 100644
index 0000000000..86a3124e73
--- /dev/null
+++ b/apps/docs/content/components/tooltip/delay.raw.jsx
@@ -0,0 +1,18 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+ Delay Open (1000ms)
+
+
+
+
+ Delay Close (2000ms)
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/delay.ts b/apps/docs/content/components/tooltip/delay.ts
index 2dec1051a3..29e870bcca 100644
--- a/apps/docs/content/components/tooltip/delay.ts
+++ b/apps/docs/content/components/tooltip/delay.ts
@@ -1,21 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
- Delay Open (1000ms)
-
-
-
-
- Delay Close (2000ms)
-
-
-
- );
-}`;
+import App from "./delay.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/offset.raw.jsx b/apps/docs/content/components/tooltip/offset.raw.jsx
new file mode 100644
index 0000000000..96e38fa36a
--- /dev/null
+++ b/apps/docs/content/components/tooltip/offset.raw.jsx
@@ -0,0 +1,23 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+
+
+ Default offset (7)
+
+
+
+
+ 15 offset
+
+
+
+
+ -7 offset
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/offset.ts b/apps/docs/content/components/tooltip/offset.ts
index d3669f7017..2fb601047c 100644
--- a/apps/docs/content/components/tooltip/offset.ts
+++ b/apps/docs/content/components/tooltip/offset.ts
@@ -1,26 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
-
-
- Default offset (7)
-
-
-
-
- 15 offset
-
-
-
-
- -7 offset
-
-
-
- );
-}`;
+import App from "./offset.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/placements.raw.jsx b/apps/docs/content/components/tooltip/placements.raw.jsx
new file mode 100644
index 0000000000..edfebd1494
--- /dev/null
+++ b/apps/docs/content/components/tooltip/placements.raw.jsx
@@ -0,0 +1,30 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ const placements = [
+ "top-start",
+ "top",
+ "top-end",
+ "bottom-start",
+ "bottom",
+ "bottom-end",
+ "left-start",
+ "left",
+ "left-end",
+ "right-start",
+ "right",
+ "right-end",
+ ];
+
+ return (
+
+ {placements.map((placement) => (
+
+
+ {placement}
+
+
+ ))}
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/placements.ts b/apps/docs/content/components/tooltip/placements.ts
index cf304818c2..dc67908b7e 100644
--- a/apps/docs/content/components/tooltip/placements.ts
+++ b/apps/docs/content/components/tooltip/placements.ts
@@ -1,38 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- const placements = [
- "top-start",
- "top",
- "top-end",
- "bottom-start",
- "bottom",
- "bottom-end",
- "left-start",
- "left",
- "left-end",
- "right-start",
- "right",
- "right-end",
- ];
-
- return (
-
- {placements.map((placement) => (
-
-
- {placement}
-
-
- ))}
-
- );
-}`;
+import App from "./placements.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/tooltip/usage.raw.jsx b/apps/docs/content/components/tooltip/usage.raw.jsx
new file mode 100644
index 0000000000..eeb11415d2
--- /dev/null
+++ b/apps/docs/content/components/tooltip/usage.raw.jsx
@@ -0,0 +1,9 @@
+import {Tooltip, Button} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ Hover me
+
+ );
+}
diff --git a/apps/docs/content/components/tooltip/usage.ts b/apps/docs/content/components/tooltip/usage.ts
index e438e386b9..1118304c37 100644
--- a/apps/docs/content/components/tooltip/usage.ts
+++ b/apps/docs/content/components/tooltip/usage.ts
@@ -1,12 +1,4 @@
-const App = `import {Tooltip, Button} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- Hover me
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/user/link-description.raw.jsx b/apps/docs/content/components/user/link-description.raw.jsx
new file mode 100644
index 0000000000..b0a3d2534f
--- /dev/null
+++ b/apps/docs/content/components/user/link-description.raw.jsx
@@ -0,0 +1,17 @@
+import {User, Link} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ @jrgarciadev
+
+ }
+ name="Junior Garcia"
+ />
+ );
+}
diff --git a/apps/docs/content/components/user/link-description.ts b/apps/docs/content/components/user/link-description.ts
index b60cfa8b82..5122872e10 100644
--- a/apps/docs/content/components/user/link-description.ts
+++ b/apps/docs/content/components/user/link-description.ts
@@ -1,20 +1,4 @@
-const App = `import {User, Link} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- @jrgarciadev
-
- )}
- avatarProps={{
- src: "https://avatars.githubusercontent.com/u/30373425?v=4"
- }}
- />
- );
-}`;
+import App from "./link-description.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/user/usage.raw.jsx b/apps/docs/content/components/user/usage.raw.jsx
new file mode 100644
index 0000000000..ef7f9a95e0
--- /dev/null
+++ b/apps/docs/content/components/user/usage.raw.jsx
@@ -0,0 +1,13 @@
+import {User} from "@nextui-org/react";
+
+export default function App() {
+ return (
+
+ );
+}
diff --git a/apps/docs/content/components/user/usage.ts b/apps/docs/content/components/user/usage.ts
index 66678b78fc..1118304c37 100644
--- a/apps/docs/content/components/user/usage.ts
+++ b/apps/docs/content/components/user/usage.ts
@@ -1,16 +1,4 @@
-const App = `import {User} 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/docs/components/autocomplete.mdx b/apps/docs/content/docs/components/autocomplete.mdx
index 6bef6b4a21..6b4cd37727 100644
--- a/apps/docs/content/docs/components/autocomplete.mdx
+++ b/apps/docs/content/docs/components/autocomplete.mdx
@@ -62,43 +62,43 @@ Autocomplete follows the [Collection Components API](https://react-spectrum.adob
- **Static**: The usage example above shows the static implementation, which can be used when the full list of options is known ahead of time.
- **Dynamic**: The example below can be used when the options come from an external data source such as an API call, or update over time.
-
+
### Disabled
-
+
### Disabled Items
You can disable specific items by using the `disabledKeys` property.
-
+
### Required
If you pass the `isRequired` property to the autocomplete, it will have a `danger` asterisk at
the end of the label and the autocomplete will be required.
-
+
### Read Only
If you pass the `isReadOnly` property to the Autocomplete, the Listbox will open to display
all available options, but users won't be able to select any of the listed options.
-
+
### Sizes
-
+
### Colors
-
+
### Variants
-
+
### Label Placements
@@ -106,7 +106,6 @@ You can change the position of the label by setting the `labelPlacement` propert
@@ -117,7 +116,7 @@ You can change the position of the label by setting the `labelPlacement` propert
You can use the `startContent` and `endContent` properties to add content to the start and end of
the autocomplete.
-
+
### Item Start & End Content
@@ -133,7 +132,7 @@ By default, `Autocomplete` doesn't allow users to specify a value that doesn't e
revert the input value to the current selected value on blur. By specifying `allowsCustomValue`, this behavior is
suppressed and the user is free to enter any value within the field.
-
+
### Custom Selector Icon
@@ -142,7 +141,6 @@ customize this icon by passing a custom one to the `selectorIcon` property.
@@ -155,7 +153,6 @@ You can disable this shadow by passing using the `scrollShadowProps` property.
@@ -165,7 +162,7 @@ You can disable this shadow by passing using the `scrollShadowProps` property.
You can add a description to the autocomplete by passing the `description` property.
-
+
### With Error Message
@@ -173,7 +170,6 @@ You can combine the `isInvalid` and `errorMessage` properties to show an invalid
@@ -187,7 +183,7 @@ whether through typing or option selection.
The example below uses `onSelectionChange` and `onInputChange` to update the selection and input value stored in
React state.
-
+
### Controlled
@@ -195,7 +191,6 @@ You can use the `selectedKey` and `onSelectionChange` properties to control the
@@ -226,7 +221,6 @@ import {useFilter} from "@react-aria/i18n";
title="Fully Controlled"
showPreview={false}
showOpenInCodeSandbox={false}
- highlightedLines="63-64,67,69-71"
files={autocompleteContent.fullyControlled}
/>
@@ -257,7 +251,6 @@ The following example uses the `defaultFilter` prop to filter the list of option
@@ -285,7 +278,6 @@ import {useAsyncList} from "@react-stately/data";
title="Asynchronous Filtering"
showPreview={false}
showOpenInCodeSandbox={false}
- highlightedLines="27-29,33"
files={autocompleteContent.asyncFiltering}
/>
@@ -314,7 +306,6 @@ import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
showOpenInCodeSandbox={false}
typescriptStrict={true}
title="Asynchronous Loading"
- highlightedLines="21-22,25,27"
files={autocompleteContent.asyncLoadingItems}
/>
diff --git a/apps/docs/content/docs/components/date-input.mdx b/apps/docs/content/docs/components/date-input.mdx
index 473bf7a257..3b67ba7138 100644
--- a/apps/docs/content/docs/components/date-input.mdx
+++ b/apps/docs/content/docs/components/date-input.mdx
@@ -104,9 +104,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -129,9 +129,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -153,9 +153,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -177,9 +177,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -200,9 +200,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -223,9 +223,9 @@ in multiple formats into `ZonedDateTime` objects.
diff --git a/apps/docs/content/docs/components/date-picker.mdx b/apps/docs/content/docs/components/date-picker.mdx
index 8b387403f6..ec8c1f5fce 100644
--- a/apps/docs/content/docs/components/date-picker.mdx
+++ b/apps/docs/content/docs/components/date-picker.mdx
@@ -119,9 +119,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -144,9 +144,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -168,9 +168,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -192,9 +192,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -214,9 +214,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -246,9 +246,9 @@ in multiple formats into `ZonedDateTime` objects.
diff --git a/apps/docs/content/docs/components/date-range-picker.mdx b/apps/docs/content/docs/components/date-range-picker.mdx
index 40557e7634..65b351118a 100644
--- a/apps/docs/content/docs/components/date-range-picker.mdx
+++ b/apps/docs/content/docs/components/date-range-picker.mdx
@@ -136,9 +136,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -161,9 +161,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -185,9 +185,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -209,9 +209,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -231,9 +231,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -256,9 +256,9 @@ in multiple formats into `ZonedDateTime` objects.
@@ -276,9 +276,9 @@ in multiple formats into `ZonedDateTime` objects.
diff --git a/apps/docs/content/docs/components/drawer.mdx b/apps/docs/content/docs/components/drawer.mdx
index 6a37751e84..0018f868a6 100644
--- a/apps/docs/content/docs/components/drawer.mdx
+++ b/apps/docs/content/docs/components/drawer.mdx
@@ -41,19 +41,19 @@ NextUI exports 5 drawer-related components:
diff --git a/apps/docs/content/docs/components/dropdown.mdx b/apps/docs/content/docs/components/dropdown.mdx
index 24e48716d0..dc4bb63a4d 100644
--- a/apps/docs/content/docs/components/dropdown.mdx
+++ b/apps/docs/content/docs/components/dropdown.mdx
@@ -42,18 +42,18 @@ NextUI exports 5 dropdown-related components:
@@ -75,7 +75,7 @@ Dropdown follows the [Collection Components API](https://react-spectrum.adobe.co
Dropdown items can be disabled using the `disabledKeys` prop to the `DropdownMenu` component.
-
+
> **Note**: It's important to have a unique key for each item, otherwise the disabled keys will not work.
@@ -83,13 +83,13 @@ Dropdown items can be disabled using the `disabledKeys` prop to the `DropdownMen
You can use the `onAction` prop to get the key of the selected item.
-
+
### Variants
You can use the `variant` in the `DropdownMenu` component to change the `hover` style of the dropdown items.
-
+
### Single Selection
@@ -115,7 +115,7 @@ You can set the `selectionMode` property as `multiple` to allow the user to sele
You can use the `shortcut` prop to add a shortcut to the dropdown item.
-
+
> **Note**: Dropdown does not handle the shortcut event, you need to handle it yourself.
@@ -123,7 +123,7 @@ You can use the `shortcut` prop to add a shortcut to the dropdown item.
It is possible to add icons to the dropdown items using the `startContent` / `endContent` props.
-
+
> **Note**: If you use `currentColor` as the icon color, the icon will have the same color as the item text.
@@ -133,7 +133,6 @@ You can use the `description` prop to add a description to the dropdown item.
@@ -141,7 +140,7 @@ You can use the `description` prop to add a description to the dropdown item.
You can use the `DropdownSection` component to group dropdown items.
-
+
> **Note**: Sections without a `title` must provide an `aria-label` for accessibility.
@@ -149,14 +148,14 @@ You can use the `DropdownSection` component to group dropdown items.
You can use any component as a trigger for the dropdown menu, just wrap it in the `DropdownTrigger` component.
-
+
### Changing the backdrop
As we mentioned earlier, the `Dropdown` component is an extension of the [Popover](/docs/components/popover) component,
so it accepts all the props of the Popover component, including the `backdrop` prop.
-
+
### Routing
@@ -218,7 +217,6 @@ slots to customize the dropdown.
diff --git a/apps/docs/content/docs/components/listbox.mdx b/apps/docs/content/docs/components/listbox.mdx
index e2ce6fa455..5139f7f023 100644
--- a/apps/docs/content/docs/components/listbox.mdx
+++ b/apps/docs/content/docs/components/listbox.mdx
@@ -39,14 +39,14 @@ NextUI exports 3 listbox-related components:
@@ -68,7 +68,7 @@ Listbox follows the [Collection Components API](https://react-spectrum.adobe.com
Listbox items can be disabled using the `disabledKeys` prop to the `Listbox` component.
-
+
> **Note**: It's important to have a unique key for each item, otherwise the disabled keys will not work.
@@ -76,7 +76,7 @@ Listbox items can be disabled using the `disabledKeys` prop to the `Listbox` com
You can use the `variant` in the `Listbox` component to change the `hover` style of the listbox items.
-
+
### Single Selection
@@ -84,7 +84,6 @@ You can set the `selectionMode` property as `single` to allow the user to select
@@ -94,7 +93,6 @@ You can set the `selectionMode` property as `multiple` to allow the user to sele
@@ -104,7 +102,7 @@ You can set the `selectionMode` property as `multiple` to allow the user to sele
It is possible to add icons to the listbox items using the `startContent` / `endContent` props.
-
+
> **Note**: If you use `currentColor` as the icon color, the icon will have the same color as the item text.
@@ -114,7 +112,6 @@ You can use the `description` prop to add a description to the listbox item.
@@ -128,7 +125,7 @@ You can use the `topContent` and `bottomContent` props to add content above and
You can use the `ListboxSection` component to group listbox items.
-
+
> **Note**: Sections without a `title` must provide an `aria-label` for accessibility.
diff --git a/apps/docs/content/docs/components/modal.mdx b/apps/docs/content/docs/components/modal.mdx
index 79a112fdd1..48042c1bef 100644
--- a/apps/docs/content/docs/components/modal.mdx
+++ b/apps/docs/content/docs/components/modal.mdx
@@ -42,19 +42,19 @@ NextUI exports 5 modal-related components:
diff --git a/apps/docs/content/docs/components/navbar.mdx b/apps/docs/content/docs/components/navbar.mdx
index d267c48d26..e949056967 100644
--- a/apps/docs/content/docs/components/navbar.mdx
+++ b/apps/docs/content/docs/components/navbar.mdx
@@ -44,22 +44,22 @@ NextUI exports 7 navbar-related components:
@@ -117,7 +117,6 @@ If you want to remove the `open` / `close` animation, you can pass the `disableA
asIframe
title="With Menu"
iframeInitialWidth={420}
- highlightedLines="24"
previewHeight="600px"
iframeSrc="/examples/navbar/disable-menu-animation"
files={navbarContent.disableMenuAnimation}
@@ -132,7 +131,6 @@ You can use the `isMenuOpen` and `onMenuOpenChange` props to control the navbar
title="Controlled Menu"
iframeInitialWidth={420}
previewHeight="600px"
- highlightedLines="5,23-24"
iframeSrc="/examples/navbar/controlled-menu"
files={navbarContent.controlledMenu}
/>
@@ -206,7 +204,6 @@ When the `NavbarItem` is active, it will have a `data-active` attribute. You can
title="Customizing the active item"
previewHeight="420px"
iframeSrc="/examples/navbar/custom-active-item"
- highlightedLines="9-20"
files={navbarContent.customActiveItem}
/>
diff --git a/apps/docs/content/docs/components/select.mdx b/apps/docs/content/docs/components/select.mdx
index 0469b09cab..55b476c101 100644
--- a/apps/docs/content/docs/components/select.mdx
+++ b/apps/docs/content/docs/components/select.mdx
@@ -54,7 +54,7 @@ Select follows the [Collection Components API](https://react-spectrum.adobe.com/
- **Static**: The usage example above shows the static implementation, which can be used when the full list of options is known ahead of time.
- **Dynamic**: The example below can be used when the options come from an external data source such as an API call, or update over time.
-
+
### Multiple Selection
@@ -64,24 +64,24 @@ You can use the `selectionMode="multiple"` property to allow multiple selection.
### Disabled
-
+
### Disabled Items
You can disable specific items by using the `disabledKeys` property.
-
+
### Required
If you pass the `isRequired` property to the select, it will have a `danger` asterisk at
the end of the label and the select will be required.
-
+
### Sizes
-
+
### Colors
@@ -99,7 +99,7 @@ the end of the label and the select will be required.
You can change the position of the label by setting the `labelPlacement` property to `inside`, `outside` or `outside-left`.
-
+
> **Note**: If the `label` is not passed, the `labelPlacement` property will be `outside` by default.
@@ -108,7 +108,7 @@ You can change the position of the label by setting the `labelPlacement` propert
You can use the `startContent` and `endContent` properties to add content to the start and end of
the select.
-
+
### Item Start & End Content
diff --git a/apps/docs/content/docs/components/switch.mdx b/apps/docs/content/docs/components/switch.mdx
index d76faa2e3d..91f0d5fe6f 100644
--- a/apps/docs/content/docs/components/switch.mdx
+++ b/apps/docs/content/docs/components/switch.mdx
@@ -66,7 +66,7 @@ The Switch component is used as an alternative between checked and not checked s
You can also add icons to start and end of the switch by using `startContent` and `endContent` props.
-
+
### Controlled
diff --git a/apps/docs/content/docs/components/table.mdx b/apps/docs/content/docs/components/table.mdx
index 230aa89df5..f496a12e57 100644
--- a/apps/docs/content/docs/components/table.mdx
+++ b/apps/docs/content/docs/components/table.mdx
@@ -43,20 +43,20 @@ NextUI exports 6 table-related components:
@@ -300,7 +300,6 @@ Table also supports infinite pagination. To do so, you can use the `useAsyncList
```jsx
import { useInfiniteScroll } from "@nextui-org/use-infinite-scroll";
-
import { useAsyncList } from "@react-stately/data";
```
diff --git a/apps/docs/global.d.ts b/apps/docs/global.d.ts
index 5a51aa5838..1a622ff3b6 100644
--- a/apps/docs/global.d.ts
+++ b/apps/docs/global.d.ts
@@ -7,3 +7,8 @@ declare module "*.jsx?raw" {
const content: string;
export default content;
}
+
+declare module "*.js?raw" {
+ const content: string;
+ export default content;
+}
diff --git a/apps/docs/styles/globals.css b/apps/docs/styles/globals.css
index 21033242d3..f17f8eee5d 100644
--- a/apps/docs/styles/globals.css
+++ b/apps/docs/styles/globals.css
@@ -96,3 +96,63 @@ z-index: 0;
content: counter(step);
}
}
+
+pre details[open]>summary>span:first-child::before {
+ transform: rotate(90deg);
+}
+
+pre details[open]>summary span.custom-folder {
+ display: none;
+}
+
+pre details:not([open])>summary span.ellipsis-token::after {
+ content: '...';
+}
+
+pre details:not([open])>summary span.copy-token {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border-width: 0;
+}
+
+pre details[open]>summary span.copy-token {
+ display: none;
+}
+
+pre details:not([open]) {
+ display: inline;
+}
+
+pre details:not([open])>summary span.empty-token {
+ display: none;
+}
+
+pre details:not([open])+div.token-line {
+ display: none;
+}
+
+pre summary {
+ display: inline;
+ position: relative;
+ list-style: none;
+}
+
+pre summary>span:first-child::before {
+ position: absolute;
+ display: inline-flex;
+ align-items: center;
+ height: 21px;
+ margin-left: -16px;
+ margin-top: 1px;
+ content: "▶";
+ font-size: 12px;
+ font-style: normal;
+ transition: transform 100ms;
+ color: #999;
+}
\ No newline at end of file
diff --git a/apps/docs/styles/sandpack.css b/apps/docs/styles/sandpack.css
index 56d23993e9..7c523c2bbe 100644
--- a/apps/docs/styles/sandpack.css
+++ b/apps/docs/styles/sandpack.css
@@ -26,6 +26,22 @@
max-height: 100%;
overflow: hidden;
}
+
+.sp-editor,
+.sp-editor-viewer {
+ height: auto !important;
+}
+
+.sp-editor {
+ & .token-line {
+ padding: 0px 24px;
+ }
+}
+
+.sp-code-viewer {
+ padding: 6px;
+}
+
.cm-scroller {
overflow: hidden;
max-height: 600px;
diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json
index 0475fdc067..51922b7e3b 100644
--- a/apps/docs/tsconfig.json
+++ b/apps/docs/tsconfig.json
@@ -3,9 +3,15 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
- "@/*": ["./*"],
- "tailwind-variants": ["./node_modules/tailwind-variants"],
- "contentlayer2/generated": ["./.contentlayer/generated"]
+ "@/*": [
+ "./*"
+ ],
+ "tailwind-variants": [
+ "./node_modules/tailwind-variants"
+ ],
+ "contentlayer2/generated": [
+ "./.contentlayer/generated"
+ ]
},
"allowJs": true,
"forceConsistentCasingInFileNames": true,
@@ -23,10 +29,14 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
+ "**/*.js",
"**/*.jsx",
".next/types/**/*.ts",
".contentlayer/generated",
"global.d.ts"
],
- "exclude": ["node_modules", "next-redirect.js"]
+ "exclude": [
+ "node_modules",
+ "next-redirect.js"
+ ]
}
diff --git a/package.json b/package.json
index 01d2a0ee99..5bd8eaf38a 100644
--- a/package.json
+++ b/package.json
@@ -29,9 +29,9 @@
"typecheck": "turbo typecheck",
"lint": "pnpm lint:pkg && pnpm lint:docs",
"lint:pkg": "eslint -c .eslintrc.json ./packages/**/*.{ts,tsx}",
- "lint:docs": "eslint -c .eslintrc.json ./apps/docs/**/*.{ts,tsx}",
+ "lint:docs": "eslint -c .eslintrc.json ./apps/docs/**/*.{ts,tsx,js,jsx}",
"lint:fix": "eslint --fix -c .eslintrc.json ./packages/**/*.{ts,tsx}",
- "lint:docs-fix": "eslint --fix -c .eslintrc.json ./apps/docs/**/*.{ts,tsx}",
+ "lint:docs-fix": "eslint --fix -c .eslintrc.json ./apps/docs/**/*.{ts,tsx,js,jsx}",
"check:rap": "tsx scripts/check-rap-updates.ts",
"fix:rap": "tsx scripts/fix-rap.ts",
"format:check": "prettier --check packages/**/**/src --cache",