Skip to content

Surface

A surface is applied to a component to create hierarchy within the UI. It is used to help communicate order, interactivity, and emphasize foreground and background relationships.

Import

import { Surface } from "@cfa/react-core";

Live Editor

Examples

Elevation

Radius

Props

Visit the Documentation Site for the full list of props.

NameTypeDefaultDescription
childrenReactNode-The children of the surface
classNamestring-CSS class names to apply custom styling.
elevation0 | 1 | 2 | 4 | 8 | 160The elevation of the surface.
idstring-The unique identifier for the DOM element.
radius"sm" | "md"smThe border radius of the surface.
roleAriaRole-The ARIA role assigned to the element to improve accessibility. Example roles include "button", "navigation", "dialog", etc.
styleCSSProperties-Inline styles specified as a React-compatible CSS properties object.