Skip to content

Commit

Permalink
Add iconClassName prop to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeprins committed Oct 25, 2022
1 parent a1230bd commit 5722785
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Props {
onSelect?: (option: Option) => void
isScrollable?: boolean
onClear?: () => void
iconClassName?: string
}

export interface Option {
Expand Down Expand Up @@ -47,6 +48,7 @@ export const Dropdown = forwardRef<HTMLDivElement, Props>(function Dropdown(
isSearchable = false,
isScrollable = false,
onClear,
iconClassName = '',
...other
},
ref
Expand Down Expand Up @@ -105,7 +107,7 @@ export const Dropdown = forwardRef<HTMLDivElement, Props>(function Dropdown(
>
{activeOption?.label || buttonLabel}
<svg
className={classNames('w-5 h-5 ml-2 -mr-1', {
className={classNames('w-5 h-5 ml-2 -mr-1', iconClassName, {
'opacity-0': activeOption && onClear
})}
viewBox="0 0 20 20"
Expand Down

1 comment on commit 5722785

@vercel
Copy link

@vercel vercel bot commented on 5722785 Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.