JGuang

Scroll Area

Scroll Area · Chakra UI

Preview
npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0

Scroll Area

Used to create a scrollable area with custom styled scrollbars

Constrain dimensions and verify horizontal, vertical and keyboard access. Treat virtualization, stick-to-bottom and scroll shadows as separate behaviors.

Included icon notices

The source viewer includes ICON_ATTRIBUTION.md and original notices for the icon collections used by these examples. Preserve them when redistributing examples; react-icons' wrapper license does not replace individual collection terms.

  • Lucide: ISC

Installation and initialization

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0

Initialize ChakraProvider with defaultSystem and Emotion before rendering. Preserve the host React version and inspect peer compatibility. Official npm installation supplies components, not these example source files. Use the resource setup guide for locale, next-themes and framework-specific SSR; copy the selected example source separately from npm installation.

Complete native usage example

This is the actual pinned example, not a generic API mock. Copy its source closure and retain the named export. Additional imports are listed per example below.

import { ScrollArea } from "@chakra-ui/react"
import LoremIpsum from "react-lorem-ipsum"

export const ScrollAreaBasic = () => (
  <ScrollArea.Root height="8.5rem" maxW="lg">
    <ScrollArea.Viewport>
      <ScrollArea.Content spaceY="4" textStyle="sm">
        <LoremIpsum p={3} />
      </ScrollArea.Content>
    </ScrollArea.Viewport>
    <ScrollArea.Scrollbar>
      <ScrollArea.Thumb />
    </ScrollArea.Scrollbar>
    <ScrollArea.Corner />
  </ScrollArea.Root>
)

All examples and reproduction requirements

Names identify demos, not component variant props. Copy every sourceFiles entry for the selected example. The compositions alias denotes local files, not a package. Preserve relative imports or rewrite the alias to your project's actual path. React peers are inspected separately; editor examples retain the coherent pinned Tiptap extension family.

Basic

scroll-area-basic · Named export ScrollAreaBasic · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-basic.tsx

With Variants

scroll-area-with-variants · Named export ScrollAreaWithVariants · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-with-variants.tsx

With Sizes

scroll-area-with-sizes · Named export ScrollAreaWithSizes · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-with-sizes.tsx

Horizontal

scroll-area-horizontal · Named export ScrollAreaHorizontal · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0
  • vendor/apps/compositions/src/examples/scroll-area-horizontal.tsx
  • vendor/apps/compositions/src/lib/decorative-box.tsx

Both Directions

scroll-area-both-directions · Named export ScrollAreaBothDirections · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-both-directions.tsx

With Scroll Shadow

scroll-area-with-scroll-shadow · Named export ScrollAreaWithScrollShadow · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0
  • vendor/apps/compositions/src/examples/scroll-area-with-scroll-shadow.tsx
  • vendor/apps/compositions/src/lib/decorative-box.tsx

With Thumb Styling

scroll-area-with-thumb-styling · Named export ScrollAreaWithThumbStyling · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-with-thumb-styling.tsx

Stick To Bottom

scroll-area-stick-to-bottom · Named export ScrollAreaStickToBottom · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0 use-stick-to-bottom@1.1.6
  • vendor/apps/compositions/src/examples/scroll-area-stick-to-bottom.tsx
  • vendor/apps/compositions/src/lib/decorative-box.tsx

Virtualization

scroll-area-virtualization · Named export ScrollAreaVirtualization · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 @tanstack/react-virtual@3.14.2
  • vendor/apps/compositions/src/examples/scroll-area-virtualization.tsx
  • vendor/apps/compositions/src/lib/decorative-box.tsx

With Store

scroll-area-with-store · Named export ScrollAreaWithStore · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-with-store.tsx

Scroll To Side

scroll-area-scroll-to-side · Named export ScrollAreaScrollToSide · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-scroll-to-side.tsx

Scroll To Position

scroll-area-scroll-to-position · Named export ScrollAreaScrollToPosition · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 prop-types@15.8.1 react-lorem-ipsum@1.4.10
  • vendor/apps/compositions/src/examples/scroll-area-scroll-to-position.tsx

With Rtl

scroll-area-with-rtl · Named export ScrollAreaWithRtl · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0
  • vendor/apps/compositions/src/examples/scroll-area-with-rtl.tsx

With Menu

scroll-area-with-menu · Named export ScrollAreaWithMenu · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0
  • vendor/apps/compositions/src/examples/scroll-area-with-menu.tsx

Native API and source references

The source viewer retains original declarations, imports and inheritance. Ark UI event contracts, Chakra style props and recipe types stay in their native packages; this guide does not flatten or invent their defaults. Code comments remain original source, not translated prose.

  • npm/@chakra-ui/react@3.37.0/dist/types/components/scroll-area/index.d.ts
  • npm/@chakra-ui/react@3.37.0/dist/types/components/scroll-area/namespace.d.ts
  • npm/@chakra-ui/react@3.37.0/dist/types/components/scroll-area/scroll-area.d.ts

Scoped Vite 8 interoperability

Some examples here import react-lorem-ipsum@1.4.10. The verified Vite 8 consumer uses the included authored/native-package-interop.mjs helper in its plugins list: chakraNativePackageInterop(process.cwd()). Copy that helper into the consuming build config and adjust the import path. This unwraps the package's native CommonJS default; it does not replace the component. Apply only when this export mismatch is reproduced; other bundlers may not need it.

State and installation checks

Run strict types, the target production build and real interactions. Test labels/focus/keyboard, both themes, narrow layout, empty/loading/error states where supported and cleanup after unmount. Remote demo endpoints, uploads and downloads are constrained in the preview; configure your own services. Copying a command or reaching preview-ready does not prove installation or backend success.

Provenance and license boundaries

https://github.com/chakra-ui/chakra-ui/tree/2e7517745cff2fcde0b8012f136cf99611ff262a

These are JGuang practical bilingual notes, not a full translation of upstream MDX. Original documentation and example bytes remain in vendor. Preserve repository MIT, compositions ISC metadata and separate dependency notices. The original metadata discrepancy and any missing full notices remain explicit review items; paid Chakra Pro is excluded.