-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update docs to follow the newest format
- Loading branch information
Showing
8 changed files
with
211 additions
and
223 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
apps/docs/content/components/autocomplete/virtualization-custom-item-height.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import {Autocomplete, AutocompleteItem} from "@nextui-org/react"; | ||
|
||
const generateItems = (n) => { | ||
const items = [ | ||
"Cat", | ||
"Dog", | ||
"Elephant", | ||
"Lion", | ||
"Tiger", | ||
"Giraffe", | ||
"Dolphin", | ||
"Penguin", | ||
"Zebra", | ||
"Shark", | ||
"Whale", | ||
"Otter", | ||
"Crocodile", | ||
]; | ||
|
||
const dataset = []; | ||
|
||
for (let i = 0; i < n; i++) { | ||
const item = items[i % items.length]; | ||
|
||
dataset.push({ | ||
label: `${item}${i}`, | ||
value: `${item.toLowerCase()}${i}`, | ||
description: "Sample description", | ||
}); | ||
} | ||
|
||
return dataset; | ||
}; | ||
|
||
export default function App() { | ||
const items = generateItems(1000); | ||
|
||
return ( | ||
<div className="flex w-full flex-wrap md:flex-nowrap gap-4"> | ||
<Autocomplete | ||
isVirtualized | ||
className="max-w-xs" | ||
defaultItems={items} | ||
itemHeight={40} | ||
label="Search from 1000 items" | ||
maxListboxHeight={400} | ||
placeholder="Search..." | ||
> | ||
{(item) => <AutocompleteItem key={item.value}>{item.label}</AutocompleteItem>} | ||
</Autocomplete> | ||
</div> | ||
); | ||
} |
58 changes: 1 addition & 57 deletions
58
apps/docs/content/components/autocomplete/virtualization-custom-item-height.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
apps/docs/content/components/autocomplete/virtualization-max-listbox-height.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {Autocomplete, AutocompleteItem} from "@nextui-org/react"; | ||
|
||
const generateItems = (n) => { | ||
const items = [ | ||
"Cat", | ||
"Dog", | ||
"Elephant", | ||
"Lion", | ||
"Tiger", | ||
"Giraffe", | ||
"Dolphin", | ||
"Penguin", | ||
"Zebra", | ||
"Shark", | ||
"Whale", | ||
"Otter", | ||
"Crocodile", | ||
]; | ||
|
||
const dataset = []; | ||
|
||
for (let i = 0; i < n; i++) { | ||
const item = items[i % items.length]; | ||
|
||
dataset.push({ | ||
label: `${item}${i}`, | ||
value: `${item.toLowerCase()}${i}`, | ||
description: "Sample description", | ||
}); | ||
} | ||
|
||
return dataset; | ||
}; | ||
|
||
export default function App() { | ||
const items = generateItems(1000); | ||
|
||
return ( | ||
<div className="flex w-full flex-wrap md:flex-nowrap gap-4"> | ||
<Autocomplete | ||
isVirtualized | ||
className="max-w-xs" | ||
defaultItems={items} | ||
label="Search from 1000 items" | ||
maxListboxHeight={400} | ||
placeholder="Search..." | ||
> | ||
{(item) => <AutocompleteItem key={item.value}>{item.label}</AutocompleteItem>} | ||
</Autocomplete> | ||
</div> | ||
); | ||
} |
57 changes: 1 addition & 56 deletions
57
apps/docs/content/components/autocomplete/virtualization-max-listbox-height.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
apps/docs/content/components/autocomplete/virtualization-ten-thousand.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import {Autocomplete, AutocompleteItem} from "@nextui-org/react"; | ||
|
||
const generateItems = (n) => { | ||
const items = [ | ||
"Cat", | ||
"Dog", | ||
"Elephant", | ||
"Lion", | ||
"Tiger", | ||
"Giraffe", | ||
"Dolphin", | ||
"Penguin", | ||
"Zebra", | ||
"Shark", | ||
"Whale", | ||
"Otter", | ||
"Crocodile", | ||
]; | ||
|
||
const dataset = []; | ||
|
||
for (let i = 0; i < n; i++) { | ||
const item = items[i % items.length]; | ||
|
||
dataset.push({ | ||
label: `${item}${i}`, | ||
value: `${item.toLowerCase()}${i}`, | ||
description: "Sample description", | ||
}); | ||
} | ||
|
||
return dataset; | ||
}; | ||
|
||
export default function App() { | ||
const items = generateItems(10000); | ||
|
||
return ( | ||
<div className="flex w-full flex-wrap md:flex-nowrap gap-4"> | ||
<Autocomplete | ||
isVirtualized | ||
className="max-w-xs" | ||
defaultItems={items} | ||
label="Search from 10000 items" | ||
placeholder="Search..." | ||
> | ||
{(item) => <AutocompleteItem key={item.value}>{item.label}</AutocompleteItem>} | ||
</Autocomplete> | ||
</div> | ||
); | ||
} |
56 changes: 1 addition & 55 deletions
56
apps/docs/content/components/autocomplete/virtualization-ten-thousand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
apps/docs/content/components/autocomplete/virtualization.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import {Autocomplete, AutocompleteItem} from "@nextui-org/react"; | ||
|
||
const generateItems = (n) => { | ||
const items = [ | ||
"Cat", | ||
"Dog", | ||
"Elephant", | ||
"Lion", | ||
"Tiger", | ||
"Giraffe", | ||
"Dolphin", | ||
"Penguin", | ||
"Zebra", | ||
"Shark", | ||
"Whale", | ||
"Otter", | ||
"Crocodile", | ||
]; | ||
|
||
const dataset = []; | ||
|
||
for (let i = 0; i < n; i++) { | ||
const item = items[i % items.length]; | ||
|
||
dataset.push({ | ||
label: `${item}${i}`, | ||
value: `${item.toLowerCase()}${i}`, | ||
description: "Sample description", | ||
}); | ||
} | ||
|
||
return dataset; | ||
}; | ||
|
||
export default function App() { | ||
const items = generateItems(1000); | ||
|
||
return ( | ||
<div className="flex w-full flex-wrap md:flex-nowrap gap-4"> | ||
<Autocomplete | ||
isVirtualized | ||
className="max-w-xs" | ||
defaultItems={items} | ||
label="Search from 1000 items" | ||
placeholder="Search..." | ||
> | ||
{(item) => <AutocompleteItem key={item.value}>{item.label}</AutocompleteItem>} | ||
</Autocomplete> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.