-
Notifications
You must be signed in to change notification settings - Fork 112
/
DisplayPillGroup.tsx
41 lines (38 loc) · 1.13 KB
/
DisplayPillGroup.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as React from 'react';
import {Box, safelySpreadBoxProps} from '@twilio-paste/box';
import type {HTMLPasteProps} from '@twilio-paste/types';
export interface DisplayPillGroupProps extends HTMLPasteProps<'ol'> {
'aria-label': string;
element?: string;
children: React.ReactNode;
}
/**
* Use the DisplayPillGroup to statically represent a collection of data. DisplayPillGroups should not be used
* inside of forms, or for editing data.
* @example
* <DisplayPillGroup aria-label="Your favorite sports:">
* ...
* </DisplayPillGroup>
* @see https://paste.twilio.design/components/display-pill-group
*/
export const DisplayPillGroup = React.forwardRef<HTMLUListElement, DisplayPillGroupProps>(
({element = 'DISPLAY_PILL_GROUP', ...props}, ref) => {
return (
<Box
{...safelySpreadBoxProps(props)}
element={element}
ref={ref}
as="ul"
margin="space0"
padding="space0"
display="flex"
flexWrap="wrap"
rowGap="space20"
columnGap="space20"
>
{props.children}
</Box>
);
}
);
DisplayPillGroup.displayName = 'DisplayPillGroup';