• 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

    Collapsible

    A flexible collapsible section for showing and hiding content.

    • npm
    • source
    • recipe
    • Ark
    import { Collapsible } from '@cerberus-design/react'

    Usage

    The Collapsible component allows you to show or hide content with a trigger. It is useful for accordions, dropdowns, and expandable sections.

    Collapsible content goes here.

    Effects

    To turn off the animation effect, you can set the effect prop to none on the Collapsible.Content component.

    Collapsible content goes here.

    Primitives

    You can utilize the primitive components to build a custom collapsible solution.

    ComponentDescription
    CollapsibleRootThe context provider of the collapsible.
    CollapsibleTriggerThe button that toggles the collapsible.
    CollapsibleIndicatorThe indicator that shows the state.
    CollapsibleContentThe content of the collapsible.

    Primitive Selectors

    Each primitive component has a data attribute for easy targeting.

    NameValueDescription
    data-scopecollapsibleThe scope of the components.
    data-partrootThe root container part.
    data-parttriggerThe trigger part.
    data-partindicatorThe indicator part.
    data-partcontentThe content part.

    API

    Collapsible

    The Collapsible component is an Object containing all the primitive components.

    You can see additional options for the Root component.

    Parts

    The CollapsibleParts API is the same as the Collapsible component.

    On this page

    • Edit this page on Github
    Cerberus Design System | Docs