CollapsibleInlay

Type: React component

How to get CollapsibleInlay?

JavaScript

import { CollapsibleInlay } from 'fds/components';

A CollapsibleInlay creates a white background with a border around it. This can be used to group certain components visually. For example when designing a form, an Inlay can be used inside a FormRow to group certain fields of the form together visually.

Additionally a CollapsibleInlay allows the user to collapse content of the inlay by clicking its header, showing an animation while collapsing or expanding. If collapsing the Inlay isn't needed, you can use a regular Inlay instead of a CollapsibleInlay.

Props

  1. children

    (Required)

    Type: ReactNode

  2. flex

    (Optional)

    Type: Number | String

    The value to use for CSS' flex property.

    Default value

  3. headerContent

    (Optional)

    Type: React node

    The content to render in the header.

    Default value

  4. isCollapsed

    (Required)

    Type: Boolean

    Whether or not the inlay is currently collapsed.

  5. onChange

    (Required)

    Type: Function

    A callback that is called whenever a component's value changes.

    This callback is called just before the "validate" prop is called.

    Use this callback to update local state which in turn should update the value prop of the component whose callback just fired.

    Arguments

  6. spaceVerticalSize

    (Optional)

    Type: Number | String

    The amount of vertical space (or margin) between the children of the component.

    This should be one of the following values:

    • 0 (zero, no margin at all)

    • 's' (small)

    • 'm' (medium)

    • 'l' (large)

    Default value