Skip to content

Commit

Permalink
feat(blade): add minHeight prop to CardProps (#1964)
Browse files Browse the repository at this point in the history
Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>
  • Loading branch information
AritraLeo and anuraghazra authored Jan 23, 2024
1 parent 8056292 commit d2a27c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-planets-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade": patch
---

feat(blade): add minHeight prop to Card
14 changes: 14 additions & 0 deletions packages/blade/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,21 @@ export type CardProps = {
* Sets the height of the card
*/
height?: BoxProps['height'];
/**
* Sets minimum height of the card
*/
minHeight?: BoxProps['minHeight'];
/**
* Sets minimum width of the card
*/
minWidth?: BoxProps['minWidth'];
/**
* If `true`, the card will be in selected state
* Card will have a primary color border around it.
*
* @default false
*/

isSelected?: boolean;
/**
* Makes the Card linkable by setting the `href` prop
Expand Down Expand Up @@ -146,6 +155,8 @@ const Card = ({
padding = 'spacing.7',
width,
height,
minHeight,
minWidth,
onClick,
isSelected = false,
accessibilityLabel,
Expand Down Expand Up @@ -191,13 +202,16 @@ const Card = ({
onClick={isReactNative() ? onClick : undefined}
width={width}
height={height}
minHeight={minHeight}
minWidth={minWidth}
href={href}
accessibilityLabel={accessibilityLabel}
{...metaAttribute({ name: MetaConstants.Card, testID })}
{...getStyledProps(styledProps)}
>
<CardSurface
height={height}
minHeight={minHeight}
padding={padding}
borderRadius="medium"
surfaceLevel={surfaceLevel}
Expand Down

0 comments on commit d2a27c8

Please sign in to comment.