• Docs
  • Blog
    • 0.24.0

    • Switch to dark mode
    Get Started
    Components
    Styling
    Theming

    Concepts

    OverviewCompositionTesting

    Layout

    Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

    Components

    AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

    Utilities

    Feature FlagsForLocal StoragePortalShowsplitPropsTheme

    For

    Render a list of components or a fallback. Inspired by SolidJS.

    • npm
    • source
    import { For } from '@cerberus/react'

    Usage

    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

    API

    export interface ForProps {
    each: any[]
    fallback?: ReactNode
    }
    define function For(props: ForProps): ReactNode | null

    Props

    The For component accepts the following props:

    NameDefaultDescription
    eachAn Array of items to loop through.
    fallbacknullThe content to render when the each value is empty.

    On this page

    • Edit this page on Github
    Cerberus Design System | Docs