Skip to content

Commit d800732

Browse files
committed
chore: add-custom-icon-example-to-dropdown-select
1 parent ef3a484 commit d800732

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

src/lib/dropdown/select/dropdown-container.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ const DropdownContainer: React.FC<{
3030
"cols-[repeat(auto-fill,_minmax(0,_45px))] grid grow py-4",
3131
)}
3232
>
33-
<Collection items={items}>
34-
{(item) => <Item className="listbox-item" {...item} />}
35-
</Collection>
33+
<Collection items={items}>{(item) => <Item {...item} />}</Collection>
3634
</ListBox>
3735
</Scrollbar>
3836
</Popover>

src/stories/dropdown-select.stories.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { IPreviewArgs } from "./utils";
66
import SelectComponent from "../lib/dropdown/select";
77
import { Form } from "react-aria-components";
88
import { Button } from "../lib";
9+
import Telegram from "../assets/svgs/telegram.svg";
910

1011
const meta = {
1112
component: SelectComponent,
@@ -109,3 +110,44 @@ export const RequiredSelect: Story = {
109110
</Form>
110111
),
111112
};
113+
114+
export const CustomItemIcon: Story = {
115+
args: {
116+
themeUI: "dark",
117+
backgroundUI: "light",
118+
items: [
119+
{
120+
text: "hello 1",
121+
itemValue: 1,
122+
id: 1,
123+
icon: <Telegram className="mr-2 size-4 fill-white" />,
124+
},
125+
{
126+
text: "hello 2",
127+
itemValue: 2,
128+
id: 2,
129+
icon: <Telegram className="mr-2 size-4 fill-white" />,
130+
},
131+
{
132+
text: "hello 3",
133+
itemValue: 3,
134+
id: 3,
135+
icon: <Telegram className="mr-2 size-4 fill-white" />,
136+
},
137+
{
138+
text: "hello 4",
139+
itemValue: 4,
140+
id: 4,
141+
icon: <Telegram className="mr-2 size-4 fill-white" />,
142+
},
143+
{
144+
text: "hello 5",
145+
itemValue: 5,
146+
id: 5,
147+
icon: <Telegram className="mr-2 size-4 fill-white" />,
148+
},
149+
],
150+
placeholder: "Select a value",
151+
callback: () => {},
152+
},
153+
};

0 commit comments

Comments
 (0)