Components
Collapsible
Collapsible are user-friendly interface elements that allow for the expansion or collapse of a section, enabling users to reveal or hide information as needed.
Code examples
<Collapsible.Root> <Collapsible.Trigger marginBottom={1}> <Button> Toggle </Button> </Collapsible.Trigger> <Collapsible.Content> <Box padding="4" borderWidth="1px"> Collapsible content </Box> </Collapsible.Content> </Collapsible.Root>
Code
<Collapsible />
import { Collapsible } from "@vygruppen/spor-react";
OBS! These are the props that can be used for Collapsible.Root, which wraps Collapsible.Content and Collapsible.Trigger
Props
Name | Type | Required? | Description |
|---|---|---|---|
disabled | boolean | Default false. Whether the collapsible is disabled | |
defaultOpen | boolean | Default false. The initial open state of the collapsible when rendered. | |
collapsedHeight | string | number | The height of the content while collapsed. | |
collapsedWidth | string | number | The width of the content while collapsed | |
onOpenChange | (details: OpenChangeDetails) => void | The callback invoked when the open state changes. | |
open | boolean | The controlled open state of the collapsible. |