Concepts
OverviewCompositionTestingLayout
Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrapComponents
AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltipUtilities
Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFrameHighlightJSON Tree ViewLocaleLocal StoragePortalPresenceShowsplitPropsThemeimport { For } from '@cerberus/react'The For component is used to render a list of components or a fallback. It is an abstraction of the Array.map method.
0. Cerberus
1. Design
2. System
3. Roolz
4. D00dz
import { For, Text } from '@cerberus/react'import { VStack } from 'styled-system/jsx'
function ForPreview() { const data = ['Cerberus', 'Design', 'System', 'Roolz', 'D00dz']
return ( <VStack alignItems="flex-start" gap="md"> <For each={data}> {(item, index) => ( <Text key={item} textStyle="body-lg"> {index}. {item} </Text> )} </For> </VStack> )}export interface ForProps { each: any[] fallback?: ReactNode}
define function For(props: ForProps): ReactNode | nullThe For component accepts the following props:
| Name | Default | Description |
|---|---|---|
| each | An Array of items to loop through. | |
| fallback | null | The content to render when the each value is empty. |
On this page