Skip to content

Commit 7956625

Browse files
authored
Merge pull request #485 from forestream/fix-select
Add props in Select
2 parents 29d3489 + ec2664f commit 7956625

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"changes": { "packages/components/package.json": "Patch" },
3+
"note": "Add props for <Select />",
4+
"date": "2025-11-18T08:11:31.056908200Z"
5+
}

packages/components/src/components/Select/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ interface SelectProps extends Omit<ComponentProps<'div'>, 'onChange'> {
5555
showCheck?: boolean
5656
value: string
5757
}[]
58+
triggerProps?: ComponentProps<typeof SelectTrigger>
59+
containerProps?: ComponentProps<typeof SelectContainer>
60+
optionProps?: ComponentProps<typeof SelectOption>
5861
}
5962

6063
export function Select({
@@ -69,6 +72,9 @@ export function Select({
6972
colors,
7073
typography,
7174
options,
75+
triggerProps,
76+
containerProps,
77+
optionProps,
7278
...props
7379
}: SelectProps) {
7480
const ref = useRef<HTMLDivElement>(null)
@@ -143,10 +149,14 @@ export function Select({
143149
>
144150
{options ? (
145151
<>
146-
<SelectTrigger>{children}</SelectTrigger>
147-
<SelectContainer>
152+
<SelectTrigger {...triggerProps}>{children}</SelectTrigger>
153+
<SelectContainer {...containerProps}>
148154
{options?.map((option) => (
149-
<SelectOption {...option} key={'option-' + option.value}>
155+
<SelectOption
156+
{...optionProps}
157+
{...option}
158+
key={'option-' + option.value}
159+
>
150160
{option.label ?? option.value}
151161
</SelectOption>
152162
))}

0 commit comments

Comments
 (0)