Skip to documentation

Design system / Foundations

CreativeXHub design system

Foundations

Theme values and layout utilities for spacing, corners, elevation, motion, content width and stacking order.

Visual elevation

Elevation communicates depth, not importance or stacking order. Choose flat for in-flow editorial grouping, raised for contained content, floating for detached surfaces and overlay for modal prominence. Surface color, borders, focus and z-index remain separate contracts. A shadow cannot fix an incorrect stacking context, and dark surfaces still need visible boundaries.

Live preview

Actual Card elevation variants; the default raised role preserves the existing small shadow.

flat

Same Card structure, different semantic depth.

raised

Same Card structure, different semantic depth.

floating

Same Card structure, different semantic depth.

overlay

Same Card structure, different semantic depth.

<Card elevation="flat"><CardContent>Editorial grouping</CardContent></Card>
/* Independent theme override */
--elevation-raised: var(--cxh-shadow-sm);
Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--elevation-flat
none

light

src/theming/semantics/elevation.css
--elevation-raised
var(--cxh-shadow-sm)

light

src/theming/semantics/elevation.css
--elevation-floating
var(--cxh-shadow-lg)

light

src/theming/semantics/elevation.css
--elevation-overlay
var(--cxh-shadow-xl)

light

src/theming/semantics/elevation.css
src/theming/semantics/elevation.css

Foundations are not atoms

Theme tokens, typography, motion and layout rules are design foundations in src/theming/, not UI atoms. Lucide is the component library's icon source. For icons, use an accessible name for icon-only controls, and hide purely decorative glyphs from assistive technology.

docs/decisions/ADR-0031-frontend-component-taxonomy-and-product-instances.md

Spacing and shape

Live preview

Geometry references the actual spacing and radius primitives.

--cxh-space-4
--cxh-space-8
--cxh-space-16
--cxh-space-24
--cxh-space-32
--cxh-space-48

Page spacing and component spacing

AppShell owns the shared contained and focused frames. SidebarShell owns the fluid workspace frame, with a compact 16px top inset. Its bottom padding remains responsive, and its horizontal gutters are unchanged. Contained and focused frames retain their existing vertical spacing. Console and admin instances bind template slots without duplicating those wrappers. PublicShell selects full-bleed content, so documentation supplies its own frame and brochure pages own their bands. page-frame only sizes and pads its own element; it never changes a child component’s layout. Brochure bands use page-gutters to align content without changing their deliberate vertical rhythm.

Page and section owners retain their layout mechanics and choose spacing from the existing token-backed utilities: generally space-y-8 md:space-y-12 between major blocks and space-y-6 within a content section. A grid owner uses gap utilities instead. These choices position sibling blocks; they are not instructions to reach into a Card, form, table or preview. Put internal styling in the component that owns it, not its consumer or instance.

Responsive page spacing at the default rem basis
ViewportPage guttersVertical paddingMajor block gapSection gap
Below 768px24px32px32px24px
768–1023px32px48px48px24px
1024–1439px48px48px48px24px
1440px and wider64px64px48px24px
src/theming/semantics/layout.csssrc/components/navigation/appShell.tsxdocs/decisions/ADR-0031-frontend-component-taxonomy-and-product-instances.md

spacing

Spacing primitives use an 8px grid with 1px, 2px and 4px micro steps. Select gaps at the layout owner. Tailwind spacing numbers multiply the registered 4px base rather than naming primitive pixel values.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-space-1
0.1rem

light

src/theming/primitives/spacing.css
--cxh-space-2
0.2rem

light

src/theming/primitives/spacing.css
--cxh-space-4
0.4rem

light

src/theming/primitives/spacing.css
--cxh-space-8
0.8rem

light

src/theming/primitives/spacing.css
--cxh-space-16
1.6rem

light

src/theming/primitives/spacing.css
--cxh-space-24
2.4rem

light

src/theming/primitives/spacing.css
--cxh-space-32
3.2rem

light

src/theming/primitives/spacing.css
--cxh-space-40
4rem

light

src/theming/primitives/spacing.css
--cxh-space-48
4.8rem

light

src/theming/primitives/spacing.css
--cxh-space-56
5.6rem

light

src/theming/primitives/spacing.css
--cxh-space-64
6.4rem

light

src/theming/primitives/spacing.css
--cxh-space-72
7.2rem

light

src/theming/primitives/spacing.css
--cxh-space-80
8rem

light

src/theming/primitives/spacing.css
--cxh-space-96
9.6rem

light

src/theming/primitives/spacing.css

radii

Radius primitives provide square, 2px, 4px, 8px, 16px and fully rounded treatments at the default rem basis. Select a supported radius through the component contract; do not impose corner styles from a parent selector.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-radius-none
0

light

src/theming/primitives/radii.css
--cxh-radius-sm
0.2rem

light

src/theming/primitives/radii.css
--cxh-radius-md
0.4rem

light

src/theming/primitives/radii.css
--cxh-radius-lg
0.8rem

light

src/theming/primitives/radii.css
--cxh-radius-xl
1.6rem

light

src/theming/primitives/radii.css
--cxh-radius-full
9999px

light

src/theming/primitives/radii.css

shadows

Shadow primitives define current shadow values. Semantic elevation roles map supported depth choices to those primitives. Changing a primitive affects only consumers that reference it directly or through an alias.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-shadow-xs
0 1px 2px 0 rgb(0 0 0 / 0.05)

light

src/theming/primitives/shadows.css
--cxh-shadow-sm
0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)

light

src/theming/primitives/shadows.css
--cxh-shadow-md
0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)

light

src/theming/primitives/shadows.css
--cxh-shadow-lg
0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)

light

src/theming/primitives/shadows.css
--cxh-shadow-xl
0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)

light

src/theming/primitives/shadows.css

motion

Duration primitives range from 0ms to 500ms and include easing curves. Components may use explicit animation timings instead. Check the source and reduced-motion behavior before changing an animation contract.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-duration-instant
0ms

light

src/theming/primitives/motion.css
--cxh-duration-fast
150ms

light

src/theming/primitives/motion.css
--cxh-duration-normal
250ms

light

src/theming/primitives/motion.css
--cxh-duration-slow
350ms

light

src/theming/primitives/motion.css
--cxh-duration-slower
500ms

light

src/theming/primitives/motion.css
--cxh-ease-linear
linear

light

src/theming/primitives/motion.css
--cxh-ease-in
cubic-bezier(0.4, 0, 1, 1)

light

src/theming/primitives/motion.css
--cxh-ease-out
cubic-bezier(0, 0, 0.2, 1)

light

src/theming/primitives/motion.css
--cxh-ease-in-out
cubic-bezier(0.4, 0, 0.2, 1)

light

src/theming/primitives/motion.css

layout

Container primitives define maximum widths in rem. The content container is 144rem at the default 10px rem basis. Carousel uses shadcn's default full-width slide pattern, not custom viewport-height or minimum-item-width tokens. These container dimensions constrain layout; they do not scale controls or replace responsive wrapping.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-container-xs
32rem

light

src/theming/primitives/layout.css
--cxh-container-sm
64rem

light

src/theming/primitives/layout.css
--cxh-container-md
76.8rem

light

src/theming/primitives/layout.css
--cxh-container-lg
102.4rem

light

src/theming/primitives/layout.css
--cxh-container-xl
128rem

light

src/theming/primitives/layout.css
--cxh-container-content
144rem

light

src/theming/primitives/layout.css
--cxh-container-2xl
153.6rem

light

src/theming/primitives/layout.css
--cxh-sidebar-width
28rem

light

src/theming/primitives/layout.css

z-index

Z-index primitives define named stacking levels, not dimensions. A child remains constrained by its stacking context. Increasing its z-index alone cannot place it above every element in the document.

Current token declarations from repository CSS. Swatches resolve the active documentation mode.
TokenDeclarationMode / source
--cxh-z-hide
-1

light

src/theming/primitives/z-index.css
--cxh-z-base
0

light

src/theming/primitives/z-index.css
--cxh-z-docked
1

light

src/theming/primitives/z-index.css
--cxh-z-dropdown
1000

light

src/theming/primitives/z-index.css
--cxh-z-sticky
1100

light

src/theming/primitives/z-index.css
--cxh-z-banner
1200

light

src/theming/primitives/z-index.css
--cxh-z-overlay
1300

light

src/theming/primitives/z-index.css
--cxh-z-modal
1400

light

src/theming/primitives/z-index.css
--cxh-z-popover
1500

light

src/theming/primitives/z-index.css
--cxh-z-skip-link
1600

light

src/theming/primitives/z-index.css
--cxh-z-toast
1700

light

src/theming/primitives/z-index.css
--cxh-z-tooltip
1800

light

src/theming/primitives/z-index.css

Verify motion at the component owner

Sheet defines its own 500ms entrance and 300ms exit classes. These timings do not reference primitive duration tokens. When changing motion, inspect the component's animation classes and verify a reduced-motion alternative. A token inventory is not proof of adoption.

src/components/ui/sheet.tsx
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.