diff --git a/packages/camp/src/NumberInput/NumberInput.stories.tsx b/packages/camp/src/NumberInput/NumberInput.stories.tsx index 86a52e8e..02d948f8 100644 --- a/packages/camp/src/NumberInput/NumberInput.stories.tsx +++ b/packages/camp/src/NumberInput/NumberInput.stories.tsx @@ -100,3 +100,9 @@ export const FormInput: StoryFn = (args) => { ) } + +export const InputStyles = Template.bind({}) +InputStyles.args = { + placeholder: 'Pass in input styles', + inputStyles: { bgColor: 'gray.100' }, +} diff --git a/packages/camp/src/NumberInput/NumberInput.tsx b/packages/camp/src/NumberInput/NumberInput.tsx index 9db09129..26cf122a 100644 --- a/packages/camp/src/NumberInput/NumberInput.tsx +++ b/packages/camp/src/NumberInput/NumberInput.tsx @@ -3,10 +3,10 @@ import { useRef } from 'react' import { Box, chakra, - ComponentWithAs as _, Divider, forwardRef, NumberInputProps as ChakraNumberInputProps, + SystemStyleObject, useFormControlProps, useMergeRefs, useMultiStyleConfig, @@ -29,6 +29,11 @@ export interface NumberInputProps extends ChakraNumberInputProps { * Whether to show the increment and decrement steppers. Defaults to true. */ showSteppers?: boolean + + /** + * Merge styles for inner input field + */ + inputStyles?: SystemStyleObject } export const NumberInput = forwardRef( @@ -38,6 +43,7 @@ export const NumberInput = forwardRef( clampValueOnBlur = false, isSuccess, isPrefilled, + inputStyles, ...props }, ref, @@ -90,6 +96,7 @@ export const NumberInput = forwardRef( // is this input. ref={inputRef} __css={styles.field} + sx={inputStyles} /> {showSteppers && (