diff --git a/.changeset/wicked-ties-walk.md b/.changeset/wicked-ties-walk.md new file mode 100644 index 00000000000..e6c0e7312e9 --- /dev/null +++ b/.changeset/wicked-ties-walk.md @@ -0,0 +1,5 @@ +--- +'@primer/react': minor +--- + +Add `className` prop support to `Textarea` component diff --git a/packages/react/src/Textarea/Textarea.docs.json b/packages/react/src/Textarea/Textarea.docs.json index 7e309244572..310aa038d13 100644 --- a/packages/react/src/Textarea/Textarea.docs.json +++ b/packages/react/src/Textarea/Textarea.docs.json @@ -60,7 +60,12 @@ { "name": "sx", "type": "SystemStyleObject" + }, + { + "name": "className", + "type": "string | undefined", + "description": "The className to apply to the wrapper element" } ], "subcomponents": [] -} +} \ No newline at end of file diff --git a/packages/react/src/Textarea/Textarea.tsx b/packages/react/src/Textarea/Textarea.tsx index 2e58a7ef26b..ff39ed078b9 100644 --- a/packages/react/src/Textarea/Textarea.tsx +++ b/packages/react/src/Textarea/Textarea.tsx @@ -31,6 +31,10 @@ export type TextareaProps = { * apply a high contrast color to background */ contrast?: boolean + /** + * The className to apply to the wrapper element + */ + className?: string } & TextareaHTMLAttributes & SxProp @@ -79,6 +83,7 @@ const Textarea = React.forwardRef( resize = DEFAULT_TEXTAREA_RESIZE, block, contrast, + className, ...rest }: TextareaProps, ref, @@ -90,6 +95,7 @@ const Textarea = React.forwardRef( disabled={disabled} block={block} contrast={contrast} + className={className} >