mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* fix: onSelectionChange type for dynamic items in Select component * docs: remove unnecessary properties * docs: update highlightedLines * chore: add changeset
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
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 (
|
|
<Select
|
|
label="Favorite Animal"
|
|
placeholder="Select an animal"
|
|
disabledKeys={["zebra", "tiger", "lion", "elephant", "crocodile", "whale"]}
|
|
className="max-w-xs"
|
|
>
|
|
{animals.map((animal) => (
|
|
<SelectItem key={animal.key}>
|
|
{animal.label}
|
|
</SelectItem>
|
|
))}
|
|
</Select>
|
|
);
|
|
}`;
|
|
|
|
const react = {
|
|
"/App.jsx": App,
|
|
"/data.js": data,
|
|
};
|
|
|
|
export default {
|
|
...react,
|
|
};
|