* docs: create a new UI docs project (#13233) * docs: create a new UI docs project * fix installation errors * docs: migrate UI docs content to new project (#13241) * Fix content * added examples for some components * finish adding examples * lint fix * fix build errors * delete empty files * path fixes + refactor * fix build error
59 lines
1.2 KiB
TypeScript
59 lines
1.2 KiB
TypeScript
import { Select } from "@medusajs/ui"
|
|
|
|
export default function SelectDemo() {
|
|
return (
|
|
<div className="w-[256px]">
|
|
<Select>
|
|
<Select.Trigger>
|
|
<Select.Value placeholder="Select a currency" />
|
|
</Select.Trigger>
|
|
<Select.Content>
|
|
{data.map((group) => (
|
|
<Select.Group key={group.label}>
|
|
<Select.Label>{group.label}</Select.Label>
|
|
{group.items.map((item) => (
|
|
<Select.Item key={item.value} value={item.value}>
|
|
{item.label}
|
|
</Select.Item>
|
|
))}
|
|
</Select.Group>
|
|
))}
|
|
</Select.Content>
|
|
</Select>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const data = [
|
|
{
|
|
label: "Shirts",
|
|
items: [
|
|
{
|
|
value: "dress-shirt-solid",
|
|
label: "Solid Dress Shirt",
|
|
},
|
|
{
|
|
value: "dress-shirt-check",
|
|
label: "Check Dress Shirt",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: "T-Shirts",
|
|
items: [
|
|
{
|
|
value: "v-neck",
|
|
label: "V-Neck",
|
|
},
|
|
{
|
|
value: "crew-neck",
|
|
label: "Crew Neck",
|
|
},
|
|
{
|
|
value: "henley",
|
|
label: "Henley",
|
|
},
|
|
],
|
|
},
|
|
]
|