Paper API

API reference for the Paper component: its props with their token values and defaults, the styled-system prop groups, and forwarded HTML attributes.

Demos

For usage examples, visit the component demo page: Paper

Import

import { Paper } from '@soroush.tech/design-system/Paper'

Paper-specific props

elevation

Shadow depth from 0 (flat) to 24 (highest). Resolves to theme.shadows[n] which produces a box-shadow string.

Valuebox-shadow
00 0px 0px rgba(0, 0, 0, 0.1)
10 1px 2px rgba(0, 0, 0, 0.1)
40 4px 8px rgba(0, 0, 0, 0.1)
80 8px 16px rgba(0, 0, 0, 0.1)
240 24px 48px rgba(0, 0, 0, 0.1)

Default: 1.


aspectRatio

Inherited from View. CSS aspect-ratio for fixed-ratio surfaces. Accepts any valid CSS value (e.g. "1", "4/3", "16/9"). No theme scale - raw CSS.


transition

CSS transition for surface animations, typically used for hover elevation changes. No theme scale - raw CSS.

<Paper
  elevation={1}
  transition="box-shadow 0.3s ease"
  css={{ '&:hover': { boxShadow: '0 8px 16px rgba(0,0,0,0.1)' } }}
/>

Default styles

PropDefaultResolves to
bg"paper"theme.background.paper
borderRadius"md"theme.radii.md = 8px
elevation10 1px 2px rgba(0,0,0,0.1)

bg - theme.background

TokenDark sourceLight source
"backdrop"carbonBlack[900] + 80% opacitykineticSurface[100] + 80% opacity
"modal"kineticSurface[800]kineticSurface[100]
"primary"kineticSurface[900]kineticSurface[50]
"secondary"kineticSurface[700]carbonBlack[100]
"paper"kineticSurface[800]kineticSurface[100]

Inherited props from View

Space - theme.space

PropShorthand for
m mt mr mb ml mx mymargin + sides
p pt pr pb pl px pypadding + sides

Layout

width · height · minWidth · minHeight · maxWidth · maxHeight · display · overflow · overflowX · overflowY


Border - theme.radii

border · borderWidth · borderStyle · borderColor · borderRadius · borderTop · borderRight · borderBottom · borderLeft

Radii: "sm" (4px) · "md" (8px) · "lg" (16px)


Position

position · zIndex · top · right · bottom · left


cursor

Raw CSS cursor value (e.g. "pointer", "default").


Composition

Paper has no flex or grid props. Nest Flex or Grid inside for layout:

<Paper elevation={2} p={3}>
  <Flex alignItems="center" gap={2}>
    <Avatar src="/photo.jpg" alt="Jane" />
    <Typography variant="body1">Jane Doe</Typography>
  </Flex>
</Paper>

<Paper elevation={1} aspectRatio="16/9">
  <Flex height="100%" alignItems="center" justifyContent="center">
    <Typography variant="h4">16:9 Surface</Typography>
  </Flex>
</Paper>

Source code

If this page does not answer your question, have a look at the implementation of the component for more detail.