Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-ties-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
Comment thread
randall-krauskopf marked this conversation as resolved.
Outdated
---

Add `className` prop support to `Textarea` component
8 changes: 7 additions & 1 deletion packages/react/src/Textarea/Textarea.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@
{
"name": "sx",
"type": "SystemStyleObject"
},
{
"name": "className",
"type": "string | undefined",
"defaultValue": "",
"description": "CSS string"
Comment thread
randall-krauskopf marked this conversation as resolved.
Outdated
}
],
"subcomponents": []
}
}
6 changes: 6 additions & 0 deletions packages/react/src/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLTextAreaElement> &
SxProp

Expand Down Expand Up @@ -79,6 +83,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
resize = DEFAULT_TEXTAREA_RESIZE,
block,
contrast,
className,
...rest
}: TextareaProps,
ref,
Expand All @@ -90,6 +95,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
disabled={disabled}
block={block}
contrast={contrast}
className={className}
>
<StyledTextarea
value={value}
Expand Down