Skip to content

Commit fde646b

Browse files
ozkersemihenesyildirim-ty
authored andcommitted
docs(select): update storybook
1 parent e5927de commit fde646b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/components/select/bl-select.stories.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,32 @@ export const SpecialUseCaseTemplate = () => html`<bl-select style="width: 50%" p
132132
<bl-select-option value="3">Option 3</bl-select-option>
133133
</bl-select>`;
134134

135+
export const IconWithSlotTemplate = () => html`<bl-select placeholder="bl-select" label="aa">
136+
<bl-select-option value="tr" label="Türkiye">
137+
<div slot="icon" >
138+
<img style="height: 1em;" src="https://www.worldometers.info//img/flags/small/tn_tu-flag.gif">
139+
</div>
140+
Turkiye
141+
</bl-select-option>
142+
<bl-select-option value="nl" label="Netherlands">
143+
<div slot="icon">
144+
<img style="height: 1em;" src="https://www.worldometers.info//img/flags/small/tn_nl-flag.gif">
145+
</div>
146+
Netherlands
147+
</bl-select-option>
148+
<bl-select-option value="nl" label="Netherlands">
149+
<div slot="icon">
150+
<img style="height: 1em;" src="https://www.worldometers.info//img/flags/small/tn_gm-flag.gif">
151+
</div>
152+
Germany
153+
</bl-select-option>
154+
<bl-select-option value="nl" label="Netherlands">
155+
<div slot="icon">
156+
<img style="height: 1em;" src="https://www.worldometers.info//img/flags/small/tn_uk-flag.gif">
157+
</div>
158+
United Kingdom
159+
</bl-select-option></bl-select>`;
160+
135161
export const SelectTemplate = (args) => html`<bl-select
136162
label=${ifDefined(args.label)}
137163
class=${ifDefined(args.class)}
@@ -355,6 +381,13 @@ If `bl-select-option` has icon by `icon` attribute, `bl-select` would render the
355381
</Story>
356382
</Canvas>
357383

384+
You can use slot icon in `bl-select-option` instead of `icon` attribute to display icon on `bl-select`.
385+
<Canvas>
386+
<Story name="Select With Icon Slots" args={{ options: optionsWithIcon, placeholder: "Choose Payment Method" }} play={selectOpener}>
387+
{IconWithSlotTemplate.bind({})}
388+
</Story>
389+
</Canvas>
390+
358391
## `bl-select` Event
359392

360393
Select component fires `bl-select` event once selection changes. This event has a payload in the type of

0 commit comments

Comments
 (0)