Marigold
Marigold

Application

MarigoldProvider
RouterProvider

Layout

AppLayoutbeta
Aside
Aspect
Breakout
Center
Columns
Container
Grid
Inline
Inset
Scrollable
Split
Stack
Tiles

Actions

ActionBaralpha
Button
Link
LinkButton
ToggleButtonalpha
ToggleButtonGroupalpha

Form

Autocomplete
Calendarupdated
Checkbox
ComboBox
DateField
DatePicker
FileField
Form
Multiselectdeprecated
NumberField
Radio
SearchField
Select
Slider
Switch
TagFieldbeta
TextArea
TextField
TimeField

Collection

SelectList
Tableupdated
Tag

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ContextualHelp
Dialog
Drawer
Menu
Toastbeta
Tooltip

Content

Badge
Card
Divider
EmptyStatebeta
Headline
Icon
List
Loader
SectionMessage
SVG
Text

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useListData
useResponsiveValue
useTheme
VisuallyHidden
Components

Scrollable

Lets the content scroll.

<Scrollable> is a component container for creating scrollable areas in the UI. Scrollbars can be both vertical and horizontal.

Usage

This component is commonly used in applications to manage large amounts of information or data, providing a convenient way for users to explore content without overwhelming the available screen space. The children of the <Scrollable> will scroll inside the container.

By default, the width is set to 100%, you can change the width to get a horizontal scrollbar. Same you can achieve with the height property. By default this takes the available height.

The <Scrollable> component can be used with every other component where content is overflowing the container, e.g. <Card>, <Table>, etc.

Vertical Scrolling

To use the vertical scrollbar you need to set the height prop and the content has to overflow the container.

import { Scrollable } from '@marigold/components';import { Rectangle } from '@/ui/Rectangle';export default () => (  <Scrollable height="150px">    <div className="flex flex-col items-center gap-2 p-2">      {Array.from({ length: 10 }).map((_, index) => (        <Rectangle key={index} height="100px" width="200px" />      ))}    </div>  </Scrollable>);

Horizontal Scrolling

To use horizontal scrolling, you need to wrap the content in a Flexbox using flex. By default, the width prop is set to 100%. Here too, the content must extend beyond the container for the scroll bar to be displayed.

import { Scrollable } from '@marigold/components';import { Rectangle } from '@/ui/Rectangle';export default () => (  <Scrollable>    <div className="inline-flex gap-2 p-2">      {Array.from({ length: 10 }).map((_, index) => (        <Rectangle key={index} height="100px" width="200px" />      ))}    </div>  </Scrollable>);

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!
View Scrollable stories

Scrollable

Prop

Type

Related

Building layouts

Learn how to build layouts.
Last update: 18 days ago

Inset

Adds space around its children.

Split

Component that creates spacing between two flex elements.

On this page

UsageVertical ScrollingHorizontal ScrollingPropsScrollableRelated