File tree 2 files changed +36
-0
lines changed
packages/@react-spectrum/s2/src
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,22 @@ import {useDOMRef} from '@react-spectrum/utils';
34
34
import { useSpectrumContextProps } from './useSpectrumContextProps' ;
35
35
36
36
export interface CardProps extends Omit < GridListItemProps , 'className' | 'style' | 'children' > , StyleProps {
37
+ /** The children of the Card. */
37
38
children : ReactNode ,
39
+ /**
40
+ * The size of the Card.
41
+ * @default 'M'
42
+ */
38
43
size ?: 'XS' | 'S' | 'M' | 'L' | 'XL' ,
44
+ /**
45
+ * The amount of internal padding within the Card.
46
+ * @default 'regular'
47
+ */
39
48
density ?: 'compact' | 'regular' | 'spacious' ,
49
+ /**
50
+ * The visual style of the Card.
51
+ * @default 'primary'
52
+ */
40
53
variant ?: 'primary' | 'secondary' | 'tertiary' | 'quiet'
41
54
}
42
55
Original file line number Diff line number Diff line change @@ -27,13 +27,36 @@ import {useLoadMore} from '@react-aria/utils';
27
27
import { useMemo , useRef } from 'react' ;
28
28
29
29
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
+ */
30
34
layout ?: 'grid' | 'waterfall' ,
35
+ /**
36
+ * The size of the cards.
37
+ * @default 'M'
38
+ */
31
39
size ?: 'XS' | 'S' | 'M' | 'L' | 'XL' ,
40
+ /**
41
+ * The amount of space between the cards.
42
+ * @default 'regular'
43
+ */
32
44
density ?: 'compact' | 'regular' | 'spacious' ,
45
+ /**
46
+ * The visual style of the cards.
47
+ * @default 'primary'
48
+ */
33
49
variant ?: 'primary' | 'secondary' | 'tertiary' | 'quiet' ,
50
+ /**
51
+ * How selection should be displayed.
52
+ * @default 'checkbox'
53
+ */
34
54
selectionStyle ?: 'checkbox' | 'highlight' ,
55
+ /** The loading state of the CardView. */
35
56
loadingState ?: LoadingState ,
57
+ /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
36
58
onLoadMore ?: ( ) => void ,
59
+ /** Spectrum-defined styles, returned by the `style()` macro. */
37
60
styles ?: StylesPropWithHeight
38
61
}
39
62
You can’t perform that action at this time.
0 commit comments