Paper

Renders white or dark background depending on color scheme. Use it to create cards, dropdowns, modals and other components that require a background with shadow.

Import

import { Paper } from '@tidbcloud/uikit'

Basic Usage

import { Paper, Text } from '@tidbcloud/uikit'
 
function Demo() {
  return (
    <Paper p="xl">
      <Text>Paper is the most basic UI component</Text>
      <Text>Use it to create cards, dropdowns, modals and other components that require background with shadow</Text>
    </Paper>
  )
}

With Shadow

import { Paper, Text } from '@tidbcloud/uikit'
 
function Demo() {
  return (
    <Paper shadow="xs" p="xl">
      <Text>Paper with extra small shadow</Text>
    </Paper>
  )
}

With Border

import { Paper, Text } from '@tidbcloud/uikit'
 
function Demo() {
  return (
    <Paper withBorder p="xl">
      <Text>Paper with border</Text>
    </Paper>
  )
}

With Radius

import { Paper, Text } from '@tidbcloud/uikit'
 
function Demo() {
  return (
    <Paper radius="md" p="xl">
      <Text>Paper with medium border radius</Text>
    </Paper>
  )
}

Key Props

PropTypeDescription
shadowMantineShadowBox shadow from theme or CSS value
radiusMantineRadiusBorder radius from theme or CSS value
withBorderbooleanAdds border to the element
pMantineSpacingPadding shorthand
componentElementTypePolymorphic component root element