Skip to main content

DCard

Card container component with composable header, body, and footer sections.

Basic Usage

import DCard from '@dynamic-framework/ui-react';

function App() {
  return (
    <DCard>
      <DCard.Header>Card Header</DCard.Header>
      <DCard.Body>Card content goes here</DCard.Body>
      <DCard.Footer>Card Footer</DCard.Footer>
    </DCard>
  );
}

Props

className
string
Additional CSS classes
style
CSSProperties
Inline styles
dataAttributes
DataAttributes
Data attributes

Subcomponents

DCard.Header

Card header section

DCard.Body

Card body section (main content area) Card footer section

Examples

<DCard>
  <DCard.Body>
    This is a simple card with just a body.
  </DCard.Body>
</DCard>

TypeScript Interface

type Props = PropsWithChildren<BaseProps>;

function DCard(props: Props): JSX.Element;

DCard.Header: (props: PropsWithChildren<BaseProps>) => JSX.Element;
DCard.Body: (props: PropsWithChildren<BaseProps>) => JSX.Element;
DCard.Footer: (props: PropsWithChildren<BaseProps>) => JSX.Element;

DLayout

Grid-based layout system with responsive gap control.

Basic Usage

import DLayout from '@dynamic-framework/ui-react';

function App() {
  return (
    <DLayout gap={3} columns={12}>
      <DLayout.Pane columnSpan={6}>
        Left Column
      </DLayout.Pane>
      <DLayout.Pane columnSpan={6}>
        Right Column
      </DLayout.Pane>
    </DLayout>
  );
}

Props

gap
number
Gap spacing on scale from 0 to 30
gapSm
number
Gap spacing for small breakpoint
gapMd
number
Gap spacing for medium breakpoint
gapLg
number
Gap spacing for large breakpoint
gapXl
number
Gap spacing for extra large breakpoint
gapXxl
number
Gap spacing for 2x extra large breakpoint
columns
number
Number of columns in grid (sets —bs-columns CSS variable)

DLayout.Pane Props

The DLayout.Pane component accepts responsive column span props:
columnSpan
number
Default column span
columnSpanSm
number
Column span for small breakpoint
columnSpanMd
number
Column span for medium breakpoint
columnSpanLg
number
Column span for large breakpoint
columnSpanXl
number
Column span for extra large breakpoint
columnSpanXxl
number
Column span for 2x extra large breakpoint

Examples

<DLayout gap={4} columns={12}>
  <DLayout.Pane columnSpan={8}>
    <DCard>
      <DCard.Body>Main content (8 columns)</DCard.Body>
    </DCard>
  </DLayout.Pane>
  <DLayout.Pane columnSpan={4}>
    <DCard>
      <DCard.Body>Sidebar (4 columns)</DCard.Body>
    </DCard>
  </DLayout.Pane>
</DLayout>

TypeScript Interface

type Gap = number; // 0 to 30

type Props = PropsWithChildren<BaseProps & {
  gap?: Gap;
  gapSm?: Gap;
  gapMd?: Gap;
  gapLg?: Gap;
  gapXl?: Gap;
  gapXxl?: Gap;
  columns?: number;
}>;

DBox

Simple container component for wrapping content.

Basic Usage

import DBox from '@dynamic-framework/ui-react';

function App() {
  return (
    <DBox className="p-4 bg-light rounded">
      <h3>Content Title</h3>
      <p>Content goes here</p>
    </DBox>
  );
}

Props

className
string
Additional CSS classes
style
CSSProperties
Inline styles
dataAttributes
DataAttributes
Data attributes

Examples

// Simple container
<DBox className="p-3">
  <p>Simple box with padding</p>
</DBox>

// Custom styled box
<DBox 
  className="border rounded shadow-sm" 
  style={{ backgroundColor: '#f8f9fa' }}
>
  <h4>Custom Box</h4>
  <p>With custom styling</p>
</DBox>

// Data attributes
<DBox 
  dataAttributes={{
    'data-testid': 'content-box',
    'data-section': 'main'
  }}
>
  <p>Box with data attributes</p>
</DBox>

TypeScript Interface

type Props = PropsWithChildren<BaseProps>;

export default function DBox(props: Props): JSX.Element;

Build docs developers (and LLMs) love