Container
RequiredBordered visual grouping root.
divLayout & content
A themed structural container that groups related content without imposing semantics.
SurfacesurfaceStylesSurfacePropsSurfaceVariantSurfacePaddingSurfaceInteractionConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
Structured content surface
Semantic variants and spacing stay aligned with the shared token system.
This JSX stays synchronized with the controls and uses only public package APIs.
import { Surface } from '@ai-created/ui';
export function Example() {
return (
<Surface>
<h2>Project status</h2>
<p>Related content belongs inside the surface.</p>
</Surface>
);
}
import { Surface, surfaceStyles } from '@ai-created/ui';Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Bordered visual grouping root.
divFree-form content that supplies the surface meaning.
The Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Layout/Surface
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish as a container component with nested content enabled.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| Variant | variant | default | variant | default, muted, accent, inset, success, warning, info, error |
| Padding | variant | none | padding | none, sm, md, lg, xl, responsive |
| Interaction | variant | none | interaction | none, group, within |
| ContentRequired | slot | None | children | No additional constraint |
Consumer-owned semantic content.
childrenOverflow: Flatten excess wrappers or remove an inner border.
Repeated framed layers obscure hierarchy.
Translatable: Nested content only
Fill its parent while height follows content.
md: responsive padding changes from 32px to 48px
Accountable owner
Design systems layout primitive owner
Canonical source: src/components/Surface.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Radius
6px
Border
1px
Padding
0 / 16 / 24 / 32 / 40px
none / sm / md / lg / xl.
Responsive padding
32px, then 48px at md
--color-surface / --color-surface2 / --color-bgStructural backgrounds.
--color-border / --color-border-strongDefault border and interaction emphasis.
--color-accent-borderAccent border.
--color-*-surface / --color-*-borderSemantic variants.
--radius-mdCorner radius.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
No component-specific keyboard behavior. Native document behavior remains unchanged.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { Surface, surfaceStyles } from '@ai-created/ui';Server Component compatible
<Surface variant="muted" padding="md">Content</Surface>These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| variant | SurfaceVariant | default | default, muted, accent, inset, success, warning, info, or error. |
| padding | SurfacePadding | none | none, sm, md, lg, xl, or responsive. |
| interaction | SurfaceInteraction | none | none, group, or within interaction styling. |
| className | string | undefined | Additional classes. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.