Skip to content

Commit 13d7b64

Browse files
committed
Add prop docs
1 parent d412c67 commit 13d7b64

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

packages/@react-spectrum/s2/src/Card.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,22 @@ import {useDOMRef} from '@react-spectrum/utils';
3434
import {useSpectrumContextProps} from './useSpectrumContextProps';
3535

3636
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children'>, StyleProps {
37+
/** The children of the Card. */
3738
children: ReactNode,
39+
/**
40+
* The size of the Card.
41+
* @default 'M'
42+
*/
3843
size?: 'XS' | 'S' | 'M' | 'L' | 'XL',
44+
/**
45+
* The amount of internal padding within the Card.
46+
* @default 'regular'
47+
*/
3948
density?: 'compact' | 'regular' | 'spacious',
49+
/**
50+
* The visual style of the Card.
51+
* @default 'primary'
52+
*/
4053
variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet'
4154
}
4255

packages/@react-spectrum/s2/src/CardView.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,36 @@ import {useLoadMore} from '@react-aria/utils';
2727
import {useMemo, useRef} from 'react';
2828

2929
export interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style'>, UnsafeStyles {
30+
/**
31+
* The layout of the cards.
32+
* @default 'grid'
33+
*/
3034
layout?: 'grid' | 'waterfall',
35+
/**
36+
* The size of the cards.
37+
* @default 'M'
38+
*/
3139
size?: 'XS' | 'S' | 'M' | 'L' | 'XL',
40+
/**
41+
* The amount of space between the cards.
42+
* @default 'regular'
43+
*/
3244
density?: 'compact' | 'regular' | 'spacious',
45+
/**
46+
* The visual style of the cards.
47+
* @default 'primary'
48+
*/
3349
variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet',
50+
/**
51+
* How selection should be displayed.
52+
* @default 'checkbox'
53+
*/
3454
selectionStyle?: 'checkbox' | 'highlight',
55+
/** The loading state of the CardView. */
3556
loadingState?: LoadingState,
57+
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
3658
onLoadMore?: () => void,
59+
/** Spectrum-defined styles, returned by the `style()` macro. */
3760
styles?: StylesPropWithHeight
3861
}
3962

0 commit comments

Comments
 (0)